summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-06-08 01:08:09 -0500
committerDave Parks <davep@lindenlab.com>2011-06-08 01:08:09 -0500
commit9b1c284d4cb678c0a7800505ac5fa3ab3e6ba095 (patch)
tree2d0429db3c22fa3e32b201435e0ae1757edf50bc /indra/newview
parentedc6ca726be6862d9e070b4ee1bfd706f8040b16 (diff)
SH-1678 Fix for busted fullbright shiny.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl33
-rw-r--r--indra/newview/lldrawpoolbump.cpp6
-rw-r--r--indra/newview/llviewershadermgr.cpp3
3 files changed, 10 insertions, 32 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index 029f282d7c..5e6c5ebec8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -9,34 +9,6 @@
#extension GL_ARB_texture_rectangle : enable
-varying float vary_texture_index;
-
-uniform sampler2D tex0;
-uniform sampler2D tex1;
-uniform sampler2D tex2;
-uniform sampler2D tex3;
-uniform sampler2D tex4;
-uniform sampler2D tex5;
-uniform sampler2D tex6;
-uniform sampler2D tex7;
-
-vec4 textureLookup(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);
- case 7: return texture2D(tex7, texcoord);
- }
-
- return vec4(0,0,0,0);
-}
-
vec3 fullbrightAtmosTransport(vec3 light);
vec3 fullbrightScaleSoftClip(vec3 light);
@@ -45,12 +17,13 @@ void main()
{
float shadow = 1.0;
- vec4 color = textureLookup(gl_TexCoord[0].xy)*gl_Color;
+ vec4 color = diffuseLookup(gl_TexCoord[0].xy)*gl_Color;
color.rgb = fullbrightAtmosTransport(color.rgb);
color.rgb = fullbrightScaleSoftClip(color.rgb);
- gl_FragColor = color;
+ //gl_FragColor = color;
+ gl_FragColor = vec4(1,0,1,1);
}
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 8985d3680e..813b3820ee 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -537,6 +537,12 @@ void LLDrawPoolBump::beginFullbrightShiny()
gGL.getTexUnit(cube_channel)->bind(cube_map);
gGL.getTexUnit(0)->activate();
}
+
+ if (mVertexShaderLevel > 1)
+ { //indexed texture rendering, channel 0 is always diffuse
+ diffuse_channel = 0;
+ }
+
mShiny = TRUE;
}
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index a1cb6d4ea6..e3ed2d0649 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -1303,8 +1303,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredFullbrightProgram.mFeatures.calculatesAtmospherics = true;
gDeferredFullbrightProgram.mFeatures.hasGamma = true;
gDeferredFullbrightProgram.mFeatures.hasTransport = true;
- gDeferredFullbrightProgram.mFeatures.isFullbright = true;
- gDeferredFullbrightProgram.mFeatures.mIndexedTextureChannels = 0;
+ gDeferredFullbrightProgram.mFeatures.mIndexedTextureChannels = gGLManager.mNumTextureImageUnits;
gDeferredFullbrightProgram.mShaderFiles.clear();
gDeferredFullbrightProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER_ARB));
gDeferredFullbrightProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB));