summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/deferred
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-10-10 18:53:43 -0500
committerDave Parks <davep@lindenlab.com>2022-10-10 18:53:43 -0500
commit07bca31e06e4219401f82ae04539418c65e22ea8 (patch)
treed5190e4cad4e3a70b7077e2fd3f56201dff79c5b /indra/newview/app_settings/shaders/class2/deferred
parent5890f423b4ae0f372d72af413b2296e5291bfa67 (diff)
SL-18190 Fix alpha not playing nice with water surface by split LLDrawPoolAlpha into two passes, one above water, one below water, and clip against water plane. Currently brute forces two complete alpha passes, still need to cull against water plane and add support for fullbright shaders.
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred')
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl3
2 files changed, 7 insertions, 0 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index b4406aabc0..b3f15f81f1 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -69,6 +69,8 @@ uniform vec3 light_direction[8];
uniform vec4 light_attenuation[8];
uniform vec3 light_diffuse[8];
+void waterClip(vec3 pos);
+
#ifdef WATER_FOG
vec4 applyWaterFogView(vec3 pos, vec4 color);
#endif
@@ -181,6 +183,7 @@ void main()
frag *= screen_res;
vec4 pos = vec4(vary_position, 1.0);
+ waterClip(pos.xyz);
vec3 norm = vary_norm;
float shadow = 1.0f;
@@ -295,6 +298,7 @@ void main()
#endif // #else // FOR_IMPOSTOR
+ //color.rgb = waterPlane.xyz * 0.5 + 0.5;
frag_color = color;
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl
index 9bbc4f87bf..922da0c441 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl
@@ -84,6 +84,8 @@ float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen);
void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv,
vec3 pos, vec3 norm, float glossiness);
+void waterClip(vec3 pos);
+
// PBR interface
vec3 pbrIbl(vec3 diffuseColor,
vec3 specularColor,
@@ -139,6 +141,7 @@ void main()
vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir;
vec3 pos = vary_position;
+ waterClip(pos);
// IF .mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels;
// vec3 col = vertex_color.rgb * diffuseLookup(vary_texcoord0.xy).rgb;