diff options
author | Dave Parks <davep@lindenlab.com> | 2022-10-07 19:27:19 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-10-07 19:27:19 -0500 |
commit | 25bff0c21dafcfca4d098f2d51a46a09c543a12c (patch) | |
tree | 71e96118cd318ebf0818b78c67bda99ea82dbab8 /indra/newview/app_settings/shaders/class1/environment | |
parent | 18309bc7fbfefa7aec29b24b727de7fe07da96fe (diff) |
SL-18190 Move water shaders to class 3, add debug stub for underWaterF.glsl, make underWaterF and softenLightF apply water fog in linear space.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/environment')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl | 49 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl | 6 |
2 files changed, 8 insertions, 47 deletions
diff --git a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl index 8c8bd6d0d5..ad105c616c 100644 --- a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl @@ -23,55 +23,10 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif - -uniform sampler2D diffuseMap; -uniform sampler2D bumpMap; -uniform sampler2D screenTex; -uniform sampler2D refTex; -uniform sampler2D screenDepth; - -uniform vec4 fogCol; -uniform vec3 lightDir; -uniform vec3 specular; -uniform float lightExp; -uniform vec2 fbScale; -uniform float refScale; -uniform float znear; -uniform float zfar; -uniform float kd; -uniform vec4 waterPlane; -uniform vec3 eyeVec; -uniform vec4 waterFogColor; -uniform float waterFogKS; -uniform vec2 screenRes; - -//bigWave is (refCoord.w, view.w); -VARYING vec4 refCoord; -VARYING vec4 littleWave; -VARYING vec4 view; - -vec4 applyWaterFogView(vec3 pos, vec4 color); +// debug stub void main() { - vec4 color; - - //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; - vec3 wavef = normalize(wave1+wave2+wave3); - - //figure out distortion vector (ripply) - vec2 distort = (refCoord.xy/refCoord.z) * 0.5 + 0.5; - distort = distort+wavef.xy*refScale; - - vec4 fb = texture2D(screenTex, distort); - - frag_color = applyWaterFogView(view.xyz, fb); + frag_color = vec4(0, 1, 1, 0); } diff --git a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl index 7dbba12502..011b3c8643 100644 --- a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl @@ -75,10 +75,16 @@ vec4 applyWaterFogView(vec3 pos, vec4 color) vec4 applyWaterFogViewLinear(vec3 pos, vec4 color) { + if (dot(pos, waterPlane.xyz) + waterPlane.w > 0.0) + { + return color; + } + vec3 view = normalize(pos); //normalize view vector float es = -(dot(view, waterPlane.xyz)); + //find intersection point with water plane and eye vector //get eye depth |