From 5c903d9c953e422a95ccd88b345d803b60ce65ff Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Fri, 21 Apr 2023 11:19:14 -0500 Subject: DRTVWR-559 Don't use automatic probes on water (fixes lots of visual artifacts) --- .../shaders/class3/deferred/reflectionProbeF.glsl | 19 ++++++++++++++++--- .../xui/en/floater_preferences_graphics_advanced.xml | 2 +- 2 files changed, 17 insertions(+), 4 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; diff --git a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml index d867123c4b..22e889a99c 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml @@ -729,7 +729,7 @@ name="1" value="1"/>