summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class3
diff options
context:
space:
mode:
authorRunitaiLinden <davep@lindenlab.com>2024-02-01 13:19:20 -0600
committerRunitaiLinden <davep@lindenlab.com>2024-02-01 13:19:20 -0600
commitb2462355a39a8473065c279c66daba307f1fa9bf (patch)
tree97b2f4631100452af9d35b0218c628d4bb80294a /indra/newview/app_settings/shaders/class3
parenta4225663ac3feb641fb8fb416889fd46b52763f5 (diff)
#677 WIP -- add mirror clipping to more shaders
Diffstat (limited to 'indra/newview/app_settings/shaders/class3')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/materialF.glsl22
2 files changed, 6 insertions, 19 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl
index 8430cca325..c382a9fbc0 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl
@@ -53,8 +53,11 @@ void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout
void applyLegacyEnv(inout vec3 color, vec3 legacyenv, vec4 spec, vec3 pos, vec3 norm, float envIntensity);
+void mirrorClip(vec3 pos);
+
void main()
{
+ mirrorClip(vary_position);
#ifdef HAS_DIFFUSE_LOOKUP
vec4 color = diffuseLookup(vary_texcoord0.xy);
#else
diff --git a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
index 8fe0e1cec8..0476b98e10 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
@@ -45,26 +45,13 @@ void calcHalfVectors(vec3 lv, vec3 n, vec3 v, out vec3 h, out vec3 l, out float
vec3 srgb_to_linear(vec3 cs);
vec3 linear_to_srgb(vec3 cs);
-uniform vec4 clipPlane;
-uniform float clipSign;
-uniform float mirror_flag;
uniform mat4 modelview_matrix;
uniform mat3 normal_matrix;
-void applyClip(vec3 pos)
-{
-
- if (mirror_flag > 0)
- {
- if ((dot(pos.xyz, clipPlane.xyz) + clipPlane.w) < 0.0)
- {
- discard;
- }
-
- }
-}
in vec3 vary_position;
+void mirrorClip(vec3 pos);
+
#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND)
out vec4 frag_color;
@@ -305,7 +292,7 @@ float getShadow(vec3 pos, vec3 norm)
void main()
{
- applyClip(vary_position);
+ mirrorClip(vary_position);
waterClip();
// diffcol == diffuse map combined with vertex color
@@ -430,9 +417,6 @@ void main()
float flag = GBUFFER_FLAG_HAS_ATMOS;
- if (mirror_flag > 0)
- flag = 1;
-
frag_data[0] = vec4(diffcol.rgb, emissive); // gbuffer is sRGB for legacy materials
frag_data[1] = vec4(spec.rgb, glossiness); // XYZ = Specular color. W = Specular exponent.
frag_data[2] = vec4(encode_normal(norm), env, flag);; // XY = Normal. Z = Env. intensity. W = 1 skip atmos (mask off fog)