[Bf-blender-cvs] [b63e6ab8d25] master: Fix Cycles SSS incorrect rendering of zero radius in green channel

Brecht Van Lommel noreply at git.blender.org
Tue Sep 22 16:35:15 CEST 2020


Commit: b63e6ab8d252a7424272f56d2e5a5b778191f987
Author: Brecht Van Lommel
Date:   Tue Sep 22 16:28:12 2020 +0200
Branches: master
https://developer.blender.org/rBb63e6ab8d252a7424272f56d2e5a5b778191f987

Fix Cycles SSS incorrect rendering of zero radius in green channel

Thanks to pembem22 for finding the problem.

Ref D8949

===================================================================

M	intern/cycles/kernel/closure/bssrdf.h

===================================================================

diff --git a/intern/cycles/kernel/closure/bssrdf.h b/intern/cycles/kernel/closure/bssrdf.h
index 4d88a822821..de65451d82c 100644
--- a/intern/cycles/kernel/closure/bssrdf.h
+++ b/intern/cycles/kernel/closure/bssrdf.h
@@ -438,7 +438,8 @@ ccl_device void bssrdf_sample(const ShaderClosure *sc, float xi, float *r, float
   }
   else if (xi < 2.0f) {
     xi -= 1.0f;
-    radius = (bssrdf->radius.x > 0.0f) ? bssrdf->radius.y : bssrdf->radius.z;
+    radius = (bssrdf->radius.x > 0.0f && bssrdf->radius.y > 0.0f) ? bssrdf->radius.y :
+                                                                    bssrdf->radius.z;
   }
   else {
     xi -= 2.0f;



More information about the Bf-blender-cvs mailing list