diff options
author | Dave Parks <davep@lindenlab.com> | 2022-10-12 14:46:51 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-10-12 14:46:51 -0500 |
commit | 42ec639c860e172803753b9cb41ae9483305f2f8 (patch) | |
tree | 43c538fda2152eef815f4a55dcdd479ca8f83bb4 /indra/newview/app_settings/shaders/class3 | |
parent | b6e576c7c2a1cb395092cc66b1836157872b131f (diff) |
SL-18190 Remove water reflection detail combo box and reimplement "Transparent Water" checkbox.
Diffstat (limited to 'indra/newview/app_settings/shaders/class3')
-rw-r--r-- | indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl | 19 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class3/environment/waterF.glsl | 7 |
2 files changed, 20 insertions, 6 deletions
diff --git a/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl index 819e6dcf15..a5e0adf8fa 100644 --- a/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl @@ -26,10 +26,12 @@ out vec4 frag_color; uniform sampler2D diffuseMap; -uniform sampler2D bumpMap; +uniform sampler2D bumpMap; + +#ifdef TRANSPARENT_WATER uniform sampler2D screenTex; -uniform sampler2D refTex; uniform sampler2D screenDepth; +#endif uniform vec4 fogCol; uniform vec3 lightDir; @@ -43,6 +45,7 @@ uniform float kd; uniform vec4 waterPlane; uniform vec3 eyeVec; uniform vec4 waterFogColor; +uniform vec3 waterFogColorLinear; uniform float waterFogKS; uniform vec2 screenRes; @@ -57,8 +60,8 @@ vec4 applyWaterFogViewLinear(vec3 pos, vec4 color); void main() { vec4 color; - - //get detail normals + + //get detail normals vec3 wave1 = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0-1.0; vec3 wave2 = texture2D(bumpMap, littleWave.xy).xyz*2.0-1.0; vec3 wave3 = texture2D(bumpMap, littleWave.zw).xyz*2.0-1.0; @@ -67,8 +70,12 @@ void main() //figure out distortion vector (ripply) vec2 distort = (refCoord.xy/refCoord.z) * 0.5 + 0.5; distort = distort+wavef.xy*refScale; - + +#ifdef TRANSPARENT_WATER vec4 fb = texture2D(screenTex, distort); - +#else + vec4 fb = vec4(waterFogColorLinear, 0.0); +#endif + frag_color = applyWaterFogViewLinear(vary_position, fb); } diff --git a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl index 9793a0e786..a6517be433 100644 --- a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl @@ -55,8 +55,10 @@ vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor, uniform sampler2D bumpMap; uniform sampler2D bumpMap2; uniform float blend_factor; +#ifdef TRANSPARENT_WATER uniform sampler2D screenTex; uniform sampler2D screenDepth; +#endif uniform sampler2D refTex; @@ -73,6 +75,7 @@ uniform float fresnelScale; uniform float fresnelOffset; uniform float blurMultiplier; uniform vec4 waterFogColor; +uniform vec3 waterFogColorLinear; //bigWave is (refCoord.w, view.w); @@ -174,6 +177,7 @@ void main() vec2 distort2 = distort + waver.xy * refScale / max(dmod * df1, 1.0); distort2 = clamp(distort2, vec2(0), vec2(0.99)); +#ifdef TRANSPARENT_WATER vec4 fb = texture2D(screenTex, distort2); float depth = texture2D(screenDepth, distort2).r; vec3 refPos = getPositionWithNDC(vec3(distort2*2.0-vec2(1.0), depth*2.0-1.0)); @@ -188,6 +192,9 @@ void main() } fb = applyWaterFogViewLinear(refPos, fb); +#else + vec4 fb = vec4(waterFogColorLinear.rgb, 0.0); +#endif vec3 sunlit; vec3 amblit; |