Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-05-14 01:18:00 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-05-14 01:18:00 +0300
commita0c564f86aafd17f1614620dbe918898635a1e35 (patch)
tree27007fcd067b55a95b90893ff5efe958188252cc /source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl
parent2c1396b6cbbe503a1d1af0a7da1f09d3086abec6 (diff)
Eevee: Hair: Disable SSR for hairs.
SSR does not work with hair strands. Basically, the rays are too much random to ever converge properly and just result in a soup of self inter reflections. So forcing it to not produce any SSR. Could potentially save some bandwidth by not rendering hair to the SSR buffers.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl')
-rw-r--r--source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl b/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl
index ca33aa99ed9..737a2977146 100644
--- a/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl
@@ -177,6 +177,13 @@ void CLOSURE_NAME(
float cos_theta = rand.x * 2.0 - 1.0;
float sin_theta = sqrt(max(0.0, 1.0f - cos_theta*cos_theta));;
N = N * sin_theta + B * cos_theta;
+
+# ifdef CLOSURE_GLOSSY
+ /* Hair random normal does not work with SSR :(.
+ * It just create self reflection feedback (which is beautifful btw)
+ * but not correct. */
+ ssr_id = NO_SSR; /* Force bypass */
+# endif
#endif
/* ---------------------------------------------------------------- */
@@ -385,6 +392,12 @@ void CLOSURE_NAME(
}
out_spec += spec_accum.rgb * ssr_spec * spec_occlu * float(specToggle);
+
+# ifdef HAIR_SHADER
+ /* Hack: Overide spec color so that ssr will not be computed
+ * even if ssr_id match the active ssr. */
+ ssr_spec = vec3(0.0);
+# endif
#endif
#ifdef CLOSURE_REFRACTION