diff options
author | RunitaiLinden <davep@lindenlab.com> | 2024-01-19 11:36:56 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-19 11:36:56 -0600 |
commit | 6dd260c3699148b4ddf8e7bff84f4b19f8bbf076 (patch) | |
tree | 6c9144f701ecb2cda859baaeed4e2f4ee6f9a683 /indra/newview/app_settings/shaders/class1/deferred | |
parent | 45547c7bbadf15804f54bb28fd1c94eb5f080bf5 (diff) | |
parent | 09ee84f675cf08f98cbd49516c5e01c289b42a20 (diff) |
Merge branch 'release/materials_featurette' into DRTVWR-592
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred')
5 files changed, 16 insertions, 19 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl index 9e61b6b894..c95f791dbf 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl @@ -34,6 +34,6 @@ void main() { // NOTE: when this shader is used, only alpha is being written to float a = diffuseLookup(vary_texcoord0.xy).a*vertex_color.a; - frag_color = vec4(0, 0, 0, a); + frag_color = max(vec4(0, 0, 0, a), vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl index 5d58cc91cd..a6fab10791 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl @@ -35,21 +35,19 @@ in vec3 vary_position; in vec4 vertex_color; in vec2 vary_texcoord0; -#ifdef WATER_FOG -vec4 applyWaterFogView(vec3 pos, vec4 color); -#endif - vec3 srgb_to_linear(vec3 cs); vec3 linear_to_srgb(vec3 cl); -vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten); -void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten); #ifdef HAS_ALPHA_MASK uniform float minimum_alpha; #endif #ifdef IS_ALPHA +uniform vec4 waterPlane; void waterClip(vec3 pos); +void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, + out vec3 atten); +vec4 applySkyAndWaterFog(vec3 pos, vec3 additive, vec3 atten, vec4 color); #endif void main() @@ -78,26 +76,21 @@ void main() vec3 pos = vary_position; + color.a = final_alpha; #ifndef IS_HUD + color.rgb = srgb_to_linear(color.rgb); +#ifdef IS_ALPHA + vec3 sunlit; vec3 amblit; vec3 additive; vec3 atten; calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten); -#endif -#ifdef WATER_FOG + color.rgb = applySkyAndWaterFog(pos, additive, atten, color).rgb; - vec4 fogged = applyWaterFogView(pos, vec4(color.rgb, final_alpha)); - color.rgb = fogged.rgb; - color.a = fogged.a; -#else - color.a = final_alpha; #endif -#ifndef IS_HUD - color.rgb = srgb_to_linear(color.rgb); - color.rgb = atmosFragLighting(color.rgb, additive, atten); #endif frag_color = max(color, vec4(0)); diff --git a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl index f3e7b2ee72..183354b9bd 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl @@ -57,5 +57,8 @@ void main() frag_data[1] = vec4(0.0); frag_data[2] = vec4(0.0, 0.0, 0.0, GBUFFER_FLAG_HAS_ATMOS); frag_data[3] = vec4(c.rgb, c.a); + + // Added and commented out for a ground truth. Do not uncomment - Geenz + //gl_FragDepth = 0.999985f; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/moonV.glsl b/indra/newview/app_settings/shaders/class1/deferred/moonV.glsl index 032245a01c..c2a1dccb33 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/moonV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/moonV.glsl @@ -39,7 +39,8 @@ void main() vec4 pos = (modelview_projection_matrix * vert); // smash to *almost* far clip plane -- stars are still behind - pos.z = pos.w*0.999999; + // SL-19283 - finagle the moon position to be between clouds and stars. + pos.z = pos.w*0.999991; gl_Position = pos; vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl index 64e6bc9da2..3443785e1a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl @@ -106,7 +106,7 @@ vec3 toneMap(vec3 color) color *= exposure * exp_scale; // mix ACES and Linear here as a compromise to avoid over-darkening legacy content - color = mix(toneMapACES_Hill(color), color, 0.333); + color = mix(toneMapACES_Hill(color), color, 0.3); #endif return color; |