Skip to content
Snippets Groups Projects
Commit 5c903d9c authored by David Parks's avatar David Parks
Browse files

DRTVWR-559 Don't use automatic probes on water (fixes lots of visual artifacts)

parent d07eaf93
No related branches found
No related tags found
No related merge requests found
...@@ -651,12 +651,11 @@ vec3 sampleProbeAmbient(vec3 pos, vec3 dir) ...@@ -651,12 +651,11 @@ vec3 sampleProbeAmbient(vec3 pos, vec3 dir)
return col[1]+col[0]; 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) vec2 tc, vec3 pos, vec3 norm, float glossiness)
{ {
// TODO - don't hard code lods // TODO - don't hard code lods
float reflection_lods = max_probe_lod; float reflection_lods = max_probe_lod;
preProbeSample(pos);
vec3 refnormpersp = reflect(pos.xyz, norm.xyz); vec3 refnormpersp = reflect(pos.xyz, norm.xyz);
...@@ -676,10 +675,24 @@ void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv, ...@@ -676,10 +675,24 @@ void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv,
#endif #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, void sampleReflectionProbesWater(inout vec3 ambenv, inout vec3 glossenv,
vec2 tc, vec3 pos, vec3 norm, float glossiness) 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 // fudge factor to get PBR water at a similar luminance ot legacy water
glossenv *= 0.4; glossenv *= 0.4;
......
...@@ -729,7 +729,7 @@ ...@@ -729,7 +729,7 @@
name="1" name="1"
value="1"/> value="1"/>
<combo_box.item <combo_box.item
label="Manual + terrain and water" label="Manual + terrain"
name="2" name="2"
value="2"/> value="2"/>
<combo_box.item <combo_box.item
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment