- shaders for both lightmapped objects with or without albedo maps
[laserbrain_demo] / sdr / lightmap-tex.p.glsl
diff --git a/sdr/lightmap-tex.p.glsl b/sdr/lightmap-tex.p.glsl
new file mode 100644 (file)
index 0000000..4983963
--- /dev/null
@@ -0,0 +1,15 @@
+/* vi: set ft=glsl */
+uniform sampler2D texmap;
+uniform sampler2D lightmap;
+
+void main()
+{
+       vec3 texel = texture2D(texmap, gl_TexCoord[0].st).rgb;
+       vec3 lumel = texture2D(lightmap, gl_TexCoord[1].st).rgb;
+
+       vec3 diffuse = lumel * texel * 1.8;
+
+       vec3 ambient = gl_LightModel.ambient.rgb * texel;
+       gl_FragColor.rgb = ambient + diffuse;
+       gl_FragColor.a = gl_FrontMaterial.diffuse.a;
+}