diff options
author | Rider Linden <rider@lindenlab.com> | 2019-04-02 18:07:08 +0000 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2019-04-02 18:07:08 +0000 |
commit | 14629ca3d661c8ec798ad072c4e739571d9c1196 (patch) | |
tree | 3189d775358aedf7f047c39b4d692cb04c37b49c | |
parent | d7b47bf71f84e4d7311a532b4bfa4a3795f19ab9 (diff) | |
parent | f07a1741e91fe44423d27585e4eeb7b69542e299 (diff) |
Merged in Geenz/viewer-eep-shader-fixes (pull request #322)
Water plane rendering improvements
Approved-by: Graham Madarasz <graham@lindenlab.com>
3 files changed, 16 insertions, 23 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index a39a73f1b6..2df55f6cfc 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -134,7 +134,7 @@ void main() col += spec_contrib; } - col = mix(col.rgb, diffuse.rgb, diffuse.a); + col.rgb += diffuse.a * diffuse.rgb; if (envIntensity > 0.0) { //add environmentmap @@ -145,8 +145,10 @@ void main() if (norm.w < 0.5) { - col = mix(atmosFragLighting(col, additive, atten), fullbrightAtmosTransportFrag(col, additive, atten), diffuse.a); - col = mix(scaleSoftClip(col), fullbrightScaleSoftClip(col), diffuse.a); + //col = mix(atmosFragLighting(col, additive, atten), fullbrightAtmosTransportFrag(col, additive, atten), diffuse.a); + //col = mix(scaleSoftClipFrag(col), fullbrightScaleSoftClipFrag(col, additive, atten), diffuse.a); + col = atmosFragLighting(col, additive, atten); + col = scaleSoftClipFrag(col); } #ifdef WATER_FOG diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index be5e3538a7..c3c8683f6b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -142,32 +142,23 @@ void main() vec4 baseCol = texture2D(refTex, refvec4); refcol = mix(baseCol*df2, refcol, dweight); - - //get specular component - float spec = clamp(dot(lightDir, (reflect(viewVec,wavef))),0.0,1.0); - - //harden specular - spec = pow(spec, 128.0); - + //figure out distortion vector (ripply) vec2 distort2 = distort+wavef.xy*refScale * 0.33/max(dmod*df1, 1.0); vec4 fb = texture2D(screenTex, distort2); - //mix with reflection // Note we actually want to use just df1, but multiplying by 0.999999 gets around an nvidia compiler bug color.rgb = mix(fb.rgb, refcol.rgb, df1 * 0.99999); vec4 pos = vary_position; - color.rgb += spec * specular; - - color.rgb = atmosTransport(color.rgb); - color.rgb = scaleSoftClipFrag(color.rgb); + //color.rgb = atmosTransport(color.rgb); + //color.rgb = scaleSoftClipFrag(color.rgb) * 0; vec3 screenspacewavef = normalize((norm_mat*vec4(wavef, 1.0)).xyz); frag_data[0] = vec4(color.rgb, 1); // diffuse - frag_data[1] = vec4(0); // speccolor, spec - frag_data[2] = vec4(encode_normal(screenspacewavef.xyz*0.5+0.5), 0.05, 0);// normalxy, 0, 0 + frag_data[1] = vec4(specular * 0.4, 0.75); // speccolor, spec + frag_data[2] = vec4(encode_normal(screenspacewavef.xyz), 0.05, 0);// normalxy, 0, 0 } diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 27532ce458..28248aaf6d 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -146,7 +146,7 @@ void main() col += spec_contrib; } - col = mix(col.rgb, diffuse.rgb, diffuse.a); + col.rgb += diffuse.a * diffuse.rgb; if (envIntensity > 0.0) { //add environmentmap @@ -154,13 +154,13 @@ void main() vec3 refcol = textureCube(environmentMap, env_vec).rgb; col = mix(col.rgb, refcol, envIntensity); } - - -vec3 a = col.rgb; + if (norm.w < 0.5) { - col = mix(atmosFragLighting(col, additive, atten), fullbrightAtmosTransportFrag(col, additive, atten), diffuse.a); - col = mix(scaleSoftClipFrag(col), fullbrightScaleSoftClipFrag(col, additive, atten), diffuse.a); + //col = mix(atmosFragLighting(col, additive, atten), fullbrightAtmosTransportFrag(col, additive, atten), diffuse.a); + //col = mix(scaleSoftClipFrag(col), fullbrightScaleSoftClipFrag(col, additive, atten), diffuse.a); + col = atmosFragLighting(col, additive, atten); + col = scaleSoftClipFrag(col); } #ifdef WATER_FOG |