diff options
author | Graham Linden <graham@lindenlab.com> | 2013-07-22 10:29:49 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2013-07-22 10:29:49 -0700 |
commit | 6f62251a3d29ced4193a9a80965f33fe0318d5a0 (patch) | |
tree | 4a6d0dd46ef10ac2cadf455c5c8d7e9e013cccc5 | |
parent | 710b529372f4d7da699318c4761963ae9dde9a63 (diff) |
MATBUG-306 fix alpha knock-on from underwater lightcurve matching
-rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl | 8 | ||||
-rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/waterF.glsl | 9 | ||||
-rwxr-xr-x | indra/newview/llviewershadermgr.cpp | 4 |
3 files changed, 9 insertions, 12 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 69b29269c7..2eef99dea7 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -288,8 +288,7 @@ void main() diff.rgb = srgb_to_linear(diff.rgb); #ifdef USE_VERTEX_COLOR - diff.rgb *= vertex_color.rgb; - float vertex_color_alpha = vertex_color.a; + float vertex_color_alpha = diff.a * vertex_color.a; #else float vertex_color_alpha = 1.0; #endif @@ -306,8 +305,9 @@ void main() vec4 col = vec4(vary_ambient + dlight, vertex_color_alpha); #endif - vec4 color = gamma_diff * col; - + vec4 color = col; + color.rgb *= gamma_diff.rgb; + color.rgb = atmosLighting(color.rgb); color.rgb = scaleSoftClip(color.rgb); diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index 7415415290..34189deaad 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -186,16 +186,13 @@ void main() color.rgb = atmosTransport(color.rgb); color.rgb = scaleSoftClip(color.rgb); - //color.a = spec * sunAngle2; + color.a = sunAngle2; //wavef.z *= 0.1f; //wavef = normalize(wavef); vec3 screenspacewavef = (norm_mat*vec4(wavef, 1.0)).xyz; - // this is needed for materials in reflections, but not otherwise - // - //frag_data[0] = vec4(linear_to_srgb(color.rgb), 0.5); // diffuse - frag_data[0] = vec4(color.rgb, 0.5); // diffuse + frag_data[0] = vec4(color.rgb, color.a); // diffuse frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec - frag_data[2] = vec4(encode_normal(screenspacewavef), 0.0, 0.0); // normalxyz, displace + frag_data[2] = vec4(encode_normal(screenspacewavef.xyz*0.5+0.5), screenspacewavef.z * 0.16, 0.0);// normalxyz, env intensity } diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 25f2fbda07..8411fd250b 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1527,7 +1527,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredAlphaProgram.addPermutation("USE_INDEXED_TEX", "1"); - //gDeferredAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1"); + gDeferredAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1"); gDeferredAlphaProgram.addPermutation("HAS_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0"); gDeferredAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; @@ -1562,7 +1562,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaWaterProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAlphaWaterProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredAlphaWaterProgram.addPermutation("USE_INDEXED_TEX", "1"); - //gDeferredAlphaWaterProgram.addPermutation("USE_VERTEX_COLOR", "1"); + gDeferredAlphaWaterProgram.addPermutation("USE_VERTEX_COLOR", "1"); gDeferredAlphaWaterProgram.addPermutation("WATER_FOG", "1"); gDeferredAlphaWaterProgram.addPermutation("HAS_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0"); gDeferredAlphaWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; |