summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/environment/waterF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/waterF.glsl22
1 files changed, 22 insertions, 0 deletions
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
new file mode 100644
index 0000000000..f8b8031ce6
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
@@ -0,0 +1,22 @@
+void water_lighting(inout vec3 diff);
+
+uniform samplerCube environmentMap;
+uniform sampler2D diffuseMap;
+uniform sampler2D bumpMap;
+
+varying vec4 specular;
+
+void main()
+{
+ vec4 depth = texture2D(diffuseMap, gl_TexCoord[0].xy);
+ vec4 diff = texture2D(bumpMap, gl_TexCoord[1].xy);
+ vec3 ref = textureCube(environmentMap, gl_TexCoord[2].xyz).rgb;
+
+ diff.rgb *= depth.rgb;
+
+ vec3 col = mix(diff.rgb, ref, specular.a)+specular.rgb*diff.rgb;
+
+ water_lighting(col.rgb);
+ gl_FragColor.rgb = col.rgb;
+ gl_FragColor.a = (gl_Color.a+depth.a)*0.5;
+}