Fix Cycles SSS incorrect rendering of zero radius in green channel

Thanks to pembem22 for finding the problem.

Ref D8949
This commit is contained in:
Brecht Van Lommel 2020-09-22 16:28:12 +02:00
parent 3873a0f490
commit b63e6ab8d2
1 changed files with 2 additions and 1 deletions

View File

@ -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;