diff options
author | Dave Parks <davep@lindenlab.com> | 2022-10-10 18:53:43 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-10-10 18:53:43 -0500 |
commit | 07bca31e06e4219401f82ae04539418c65e22ea8 (patch) | |
tree | d5190e4cad4e3a70b7077e2fd3f56201dff79c5b /indra/newview/app_settings/shaders/class1 | |
parent | 5890f423b4ae0f372d72af413b2296e5291bfa67 (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/class1')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl index 2ec859fdae..9405a125fd 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl @@ -505,3 +505,28 @@ vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor, return color; } + +uniform vec4 waterPlane; +uniform float waterSign; + +// discard if given position in eye space is on the wrong side of the waterPlane according to waterSign +void waterClip(vec3 pos) +{ + // TODO: make this less branchy + if (waterSign > 0) + { + if ((dot(pos.xyz, waterPlane.xyz) + waterPlane.w) < -0.1) + { + discard; + } + } + else + { + if ((dot(pos.xyz, waterPlane.xyz) + waterPlane.w) > -0.1) + { + discard; + } + } + +} + |