summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-05-30 01:25:55 -0500
committerDave Parks <davep@lindenlab.com>2011-05-30 01:25:55 -0500
commiteca17c8993aecfd8d69c1b1765f8ac841ad29119 (patch)
treef876d76ad19db1fa18c56f7c61efd4b10648c747 /indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl
parent57725bd6a14f471cae1a0f4ac7485ab9ccd8bfc6 (diff)
SH-1682 Full integration if indexed texture rendering to improve batch size.
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl29
1 files changed, 27 insertions, 2 deletions
diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl
index 9b4b584369..277170e8af 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl
@@ -7,8 +7,33 @@
#version 120
-uniform sampler2D diffuseMap;
+
uniform samplerCube environmentMap;
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+uniform sampler2D tex2;
+uniform sampler2D tex3;
+uniform sampler2D tex4;
+uniform sampler2D tex5;
+uniform sampler2D tex6;
+
+varying float vary_texture_index;
+
+vec4 diffuseLookup(vec2 texcoord)
+{
+ switch (int(vary_texture_index+0.25))
+ {
+ case 0: return texture2D(tex0, texcoord);
+ case 1: return texture2D(tex1, texcoord);
+ case 2: return texture2D(tex2, texcoord);
+ case 3: return texture2D(tex3, texcoord);
+ case 4: return texture2D(tex4, texcoord);
+ case 5: return texture2D(tex5, texcoord);
+ case 6: return texture2D(tex6, texcoord);
+ }
+
+ return vec4(0,0,0,0);
+}
vec3 fullbrightShinyAtmosTransport(vec3 light);
vec3 fullbrightScaleSoftClip(vec3 light);
@@ -16,7 +41,7 @@ vec4 applyWaterFog(vec4 color);
void fullbright_shiny_lighting_water()
{
- vec4 color = texture2D(diffuseMap, gl_TexCoord[0].xy);
+ vec4 color = diffuseLookup(gl_TexCoord[0].xy);
color.rgb *= gl_Color.rgb;
vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb;