summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class3/environment/waterF.glsl
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-01-08 23:49:38 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-01-08 23:49:38 +0200
commit7d4de08fa9c43f6e21267cb861cbac8a9280e5ec (patch)
tree6187d0f264efa1122a76245db6a1def6f1ca13c4 /indra/newview/app_settings/shaders/class3/environment/waterF.glsl
parenta1c36a3218a7fe6eb7b646e64c6bf9bc29b24886 (diff)
parent77395eddc911e0801e50fd693f7bbaee8046aa95 (diff)
Merge branch 'main' into DRTVWR-489
# Conflicts: # indra/newview/llmaterialeditor.cpp
Diffstat (limited to 'indra/newview/app_settings/shaders/class3/environment/waterF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class3/environment/waterF.glsl14
1 files changed, 5 insertions, 9 deletions
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));