summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class3/environment
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-01-08 23:15:00 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-01-08 23:15:00 +0200
commitfe796dac711c7ecdc7d6d17e0b692abf468b754a (patch)
tree32750c8e5be3b21c2c8d6bf3cbc43eb012dba72a /indra/newview/app_settings/shaders/class3/environment
parent1cc91fac587ae0edf86d2dec42e2846e57bfafd0 (diff)
parent77395eddc911e0801e50fd693f7bbaee8046aa95 (diff)
Merge branch 'main' into DRTVWR-588-maint-W
Diffstat (limited to 'indra/newview/app_settings/shaders/class3/environment')
-rw-r--r--indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class3/environment/waterF.glsl14
2 files changed, 9 insertions, 12 deletions
diff --git a/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl
index e99ad5b474..223e55eb69 100644
--- a/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl
@@ -30,7 +30,6 @@ uniform sampler2D bumpMap;
#ifdef TRANSPARENT_WATER
uniform sampler2D screenTex;
-uniform sampler2D screenDepth;
#endif
uniform vec4 fogCol;
@@ -55,7 +54,7 @@ in vec4 littleWave;
in vec4 view;
in vec3 vary_position;
-vec4 applyWaterFogViewLinearNoClip(vec3 pos, vec4 color, vec3 sunlit);
+vec4 applyWaterFogViewLinearNoClip(vec3 pos, vec4 color);
void main()
{
@@ -77,5 +76,7 @@ void main()
vec4 fb = vec4(waterFogColorLinear, 0.0);
#endif
- frag_color = max(applyWaterFogViewLinearNoClip(vary_position, fb, vec3(1)), vec4(0));
+ fb = applyWaterFogViewLinearNoClip(vary_position, fb);
+
+ frag_color = max(fb, vec4(0));
}
diff --git a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl
index ddade462be..b364e454e8 100644
--- a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl
@@ -32,9 +32,8 @@ float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen);
#endif
vec3 scaleSoftClipFragLinear(vec3 l);
-vec3 atmosFragLightingLinear(vec3 light, vec3 additive, vec3 atten);
void calcAtmosphericVarsLinear(vec3 inPositionEye, vec3 norm, vec3 light_dir, out vec3 sunlit, out vec3 amblit, out vec3 atten, out vec3 additive);
-vec4 applyWaterFogViewLinear(vec3 pos, vec4 color, vec3 sunlit);
+vec4 applyWaterFogViewLinear(vec3 pos, vec4 color);
// PBR interface
vec2 BRDF(float NoV, float roughness);
@@ -77,7 +76,7 @@ uniform sampler2D bumpMap2;
uniform float blend_factor;
#ifdef TRANSPARENT_WATER
uniform sampler2D screenTex;
-uniform sampler2D screenDepth;
+uniform sampler2D depthMap;
#endif
uniform sampler2D refTex;
@@ -211,7 +210,7 @@ void main()
#ifdef TRANSPARENT_WATER
vec4 fb = texture(screenTex, distort2);
- float depth = texture(screenDepth, distort2).r;
+ float depth = texture(depthMap, distort2).r;
vec3 refPos = getPositionWithNDC(vec3(distort2*2.0-vec2(1.0), depth*2.0-1.0));
if (refPos.z > pos.z-0.05)
@@ -219,13 +218,12 @@ void main()
//we sampled an above water sample, don't distort
distort2 = distort;
fb = texture(screenTex, distort2);
- depth = texture(screenDepth, distort2).r;
+ depth = texture(depthMap, distort2).r;
refPos = getPositionWithNDC(vec3(distort2 * 2.0 - vec2(1.0), depth * 2.0 - 1.0));
}
- fb = applyWaterFogViewLinear(refPos, fb, sunlit);
#else
- vec4 fb = applyWaterFogViewLinear(viewVec*2048.0, vec4(1.0), sunlit_linear);
+ vec4 fb = applyWaterFogViewLinear(viewVec*2048.0, vec4(1.0));
#endif
// fudge sample on other side of water to be a tad darker
@@ -282,8 +280,6 @@ void main()
color = ((1.0 - f) * color) + fb.rgb;
- color = atmosFragLightingLinear(color, additive, atten);
-
float spec = min(max(max(punctual.r, punctual.g), punctual.b), 0.05);
frag_color = max(vec4(color, spec), vec4(0));