[Bf-blender-cvs] [4088c9fa68b] blender2.8: Eevee: Get rid of glitchy black SSR.
Clément Foucault
noreply at git.blender.org
Wed Sep 13 17:44:39 CEST 2017
Commit: 4088c9fa68b8610bb3706b8f8961faa29dd1f750
Author: Clément Foucault
Date: Wed Sep 13 17:41:00 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB4088c9fa68b8610bb3706b8f8961faa29dd1f750
Eevee: Get rid of glitchy black SSR.
Add sanitizer. I wanted to stay away from this because I think we should fix what causes NaNs in the first place. But there can be too much different factor causing NaNs and it can be because of user inputs.
===================================================================
M source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl
===================================================================
diff --git a/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl
index 1f3c7822124..355c2038dd2 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl
@@ -314,9 +314,13 @@ vec4 get_ssr_sample(
/* Do not add light if ray has failed. */
sample *= float(has_hit);
-#if 0 /* Enable to see where NANs come from. */
- sample = (any(isnan(sample))) ? vec3(0.0) : sample;
-#endif
+ /* Protection against NaNs in the history buffer.
+ * This could be removed if some previous pass has already
+ * sanitized the input. */
+ if (any(isnan(sample))) {
+ sample = vec3(0.0);
+ weight = 0.0;
+ }
return vec4(sample, mask) * weight;
}
More information about the Bf-blender-cvs
mailing list