summaryrefslogtreecommitdiffhomepage
path: root/shaders/lightmap.vert
blob: 7aba6feb5347b39486065a5ecda0205a2d160c1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
precision mediump float;

layout (location = 2) uniform sampler2D sampler0;
layout (location = 3) uniform vec3 light_color;
layout (location = 4) uniform vec2 scale;
layout (location = 5) uniform vec2 center_fragcoord;
layout (location = 6) uniform vec2 center_clip;
layout (location = 7) uniform float range;
layout (location = 8) uniform uint mode;
layout (location = 9) uniform uint falloff;

//layout (location = 0) out vec2 frag_texcoords;
//layout (location = 1) flat out vec2 frag_light_coord;

layout (location = 0) in vec3 position;

void main() {
    vec2 pos = position.xy;
    if (mode == 0)
    {
        vec2 dir = pos - center_clip;
        pos += dir * position.z * 1e4;
    }
    gl_Position = vec4(pos, 0, 1);
}