diff options
author | Graham Linden <graham@lindenlab.com> | 2019-02-01 13:41:31 -0800 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-02-01 13:41:31 -0800 |
commit | 5a8610ccb7e1f5a0e4d54170ac922e6820ce3acb (patch) | |
tree | 13af4da0c897474ca41d7c797b15fe3148ad6ada /indra/newview/app_settings/shaders/class1 | |
parent | 6716e543a160dd50913309834e7bd2d00034854c (diff) |
SL-9996, SL-1130, SL-5546
Fix bug with setting texture matrix for rigged mesh.
Fix z-fighting between sea and sky in ALM by cheating sky, stars, and moon using gl_FragDepth.
Fix handling of atmospheric haze glow w.r.t independent sun/moon positioning
(we can no longer depend on them being mutex to each other).
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
6 files changed, 25 insertions, 21 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl index baf54c1fbe..53391da9aa 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl @@ -58,7 +58,7 @@ uniform float density_multiplier; uniform float max_y; uniform vec4 glow; -uniform float sun_up_factor; +uniform float sun_moon_glow_factor; uniform vec4 cloud_color; @@ -132,7 +132,7 @@ void main() temp2.x = pow(temp2.x, glow.z); // glow.z should be negative, so we're doing a sort of (1 / "angle") function - //temp2.x *= sun_up_factor; + temp2.x *= sun_moon_glow_factor; // Add "minimum anti-solar illumination" temp2.x += .25; diff --git a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl index 7265275e36..c6c12f80f8 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl @@ -61,5 +61,7 @@ void main() frag_data[0] = vec4(c.rgb, c.a); frag_data[1] = vec4(0.0); frag_data[2] = vec4(0.0f); + + gl_FragDepth = 0.9996f; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl index 843901ea6a..6c509b7616 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl @@ -42,7 +42,6 @@ uniform float shadow_bias; uniform float spot_shadow_bias; uniform float spot_shadow_offset; -uniform float sun_up_factor; uniform mat4 inv_proj; uniform vec2 screen_res; diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl index 0613111632..f8172cae17 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl @@ -44,18 +44,20 @@ vec3 scaleSoftClip(vec3 light); void main() { - // Potential Fill-rate optimization. Add cloud calculation - // back in and output alpha of 0 (so that alpha culling kills - // the fragment) if the sky wouldn't show up because the clouds - // are fully opaque. - - vec4 color; - color = vary_HazeColor; - color *= 2.; - - /// Gamma correct for WL (soft clip effect). - frag_data[0] = vec4(scaleSoftClip(color.rgb), 1.0); - frag_data[1] = vec4(0.0,0.0,0.0,0.0); - frag_data[2] = vec4(0.5,0.5,0.0,1.0); //1.0 in norm.w masks off fog + // Potential Fill-rate optimization. Add cloud calculation + // back in and output alpha of 0 (so that alpha culling kills + // the fragment) if the sky wouldn't show up because the clouds + // are fully opaque. + + vec4 color; + color = vary_HazeColor; + color *= 2.; + + /// Gamma correct for WL (soft clip effect). + frag_data[0] = vec4(scaleSoftClip(color.rgb), 1.0); + frag_data[1] = vec4(0.0,0.0,0.0,0.0); + frag_data[2] = vec4(0.5,0.5,0.0,1.0); //1.0 in norm.w masks off fog + + gl_FragDepth = 0.999f; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl index 4ae3f7b76f..67e7604e22 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl @@ -49,8 +49,8 @@ float twinkle(){ void main() { - vec4 col_a = texture2D(diffuseMap, vary_texcoord0.xy); - vec4 col_b = texture2D(diffuseMap, vary_texcoord0.xy); + vec4 col_a = texture2D(diffuseMap, vary_texcoord0.xy); + vec4 col_b = texture2D(diffuseMap, vary_texcoord0.xy); vec4 col = mix(col_b, col_a, blend_factor); col.rgb *= vertex_color.rgb; @@ -59,8 +59,10 @@ void main() col.a = (col.a * factor) * 32.0f; col.a *= twinkle(); - frag_data[0] = col; + frag_data[0] = col; frag_data[1] = vec4(0.0f); frag_data[2] = vec4(0.0, 1.0, 0.0, 1.0); + + gl_FragDepth = 0.9998; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index 40d4c24d34..ee028d8194 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -165,11 +165,10 @@ void main() color.rgb = atmosTransport(color.rgb); color.rgb = scaleSoftClipFrag(color.rgb); - color.a = spec * sunAngle2; vec3 screenspacewavef = normalize((norm_mat*vec4(wavef, 1.0)).xyz); - frag_data[0] = vec4(color.rgb, color); // diffuse + 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 } |