From eca17c8993aecfd8d69c1b1765f8ac841ad29119 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 30 May 2011 01:25:55 -0500 Subject: SH-1682 Full integration if indexed texture rendering to improve batch size. --- .../class2/lighting/lightFullbrightShinyF.glsl | 30 ++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl') diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl index 73ff81e03a..f4ac789a74 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl @@ -7,15 +7,41 @@ #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); void fullbright_shiny_lighting() { - 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; -- cgit v1.2.3 From ece32418e7c1828a65c88e526a5afcb635c5453a Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 31 May 2011 14:35:59 -0500 Subject: SH-1682 Dynamically adjust the number of texture channels to use for indexed texture rendering based on available hardware. --- .../class2/lighting/lightFullbrightShinyF.glsl | 29 +--------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl') diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl index f4ac789a74..26f0ea84e0 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl @@ -5,36 +5,9 @@ * $/LicenseInfo$ */ -#version 120 - -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); -} +uniform samplerCube environmentMap; vec3 fullbrightShinyAtmosTransport(vec3 light); vec3 fullbrightScaleSoftClip(vec3 light); -- cgit v1.2.3