summaryrefslogtreecommitdiffhomepage
path: root/shaders/lightmap.frag
diff options
context:
space:
mode:
Diffstat (limited to 'shaders/lightmap.frag')
-rw-r--r--shaders/lightmap.frag25
1 files changed, 13 insertions, 12 deletions
diff --git a/shaders/lightmap.frag b/shaders/lightmap.frag
index 91467907..deaaa894 100644
--- a/shaders/lightmap.frag
+++ b/shaders/lightmap.frag
@@ -1,15 +1,16 @@
precision mediump float;
-layout (location = 0) uniform sampler2D sampler;
-layout (location = 1) uniform vec3 light_color;
-layout (location = 2) uniform vec2 size;
-layout (location = 3) uniform vec2 center_fragcoord;
-layout (location = 4) uniform vec2 center_clip;
-layout (location = 5) uniform float range;
-layout (location = 6) uniform uint mode;
-layout (location = 7) uniform uint falloff;
+layout (location = 2) uniform sampler2D sampler0;
+layout (location = 3) uniform vec3 light_color;
+layout (location = 4) uniform vec2 size;
+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;
-out vec4 color;
+layout (location = 0) out vec4 color0;
+layout (location = 1) out vec4 color1;
//layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord;
@@ -27,14 +28,14 @@ void main() {
float tmp = max(0, L - dist);
A = tmp*tmp / (L*L);
}
- color = vec4(light_color.rgb, A);
+ color0 = vec4(light_color.rgb * A, 1);
}
else if (mode == 2) // blend
{
- color = texture(sampler, gl_FragCoord.xy * size);
+ color1 = texture(sampler0, gl_FragCoord.xy * size);
}
else if (mode == 0) // shadows
{
- color = vec4(0, 0, 0, 1);
+ color0 = vec4(0, 0, 0, 1);
}
}