summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class3
diff options
context:
space:
mode:
authorRunitaiLinden <davep@lindenlab.com>2023-04-21 11:19:14 -0500
committerRunitaiLinden <davep@lindenlab.com>2023-04-21 11:19:14 -0500
commit5c903d9c953e422a95ccd88b345d803b60ce65ff (patch)
tree2fd6c8f8bad854d15b8845e0fc0c033dae32798a /indra/newview/app_settings/shaders/class3
parentd07eaf930269c71e0e3e19c8b61bcf0acbaa6fb6 (diff)
DRTVWR-559 Don't use automatic probes on water (fixes lots of visual artifacts)
Diffstat (limited to 'indra/newview/app_settings/shaders/class3')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl19
1 files changed, 16 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
index 36b5262104..9b42f0df5c 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
@@ -651,12 +651,11 @@ vec3 sampleProbeAmbient(vec3 pos, vec3 dir)
return col[1]+col[0];
}
-void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv,
+void doProbeSample(inout vec3 ambenv, inout vec3 glossenv,
vec2 tc, vec3 pos, vec3 norm, float glossiness)
{
// TODO - don't hard code lods
float reflection_lods = max_probe_lod;
- preProbeSample(pos);
vec3 refnormpersp = reflect(pos.xyz, norm.xyz);
@@ -676,10 +675,24 @@ void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv,
#endif
}
+void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv,
+ vec2 tc, vec3 pos, vec3 norm, float glossiness)
+{
+ preProbeSample(pos);
+ doProbeSample(ambenv, glossenv, tc, pos, norm, glossiness);
+}
+
void sampleReflectionProbesWater(inout vec3 ambenv, inout vec3 glossenv,
vec2 tc, vec3 pos, vec3 norm, float glossiness)
{
- sampleReflectionProbes(ambenv, glossenv, tc, pos, norm, glossiness);
+ // don't sample automatic probes for water
+ sample_automatic = false;
+ preProbeSample(pos);
+ sample_automatic = true;
+ // always include void probe on water
+ probeIndex[probeInfluences++] = 0;
+
+ doProbeSample(ambenv, glossenv, tc, pos, norm, glossiness);
// fudge factor to get PBR water at a similar luminance ot legacy water
glossenv *= 0.4;