02a488d0fe
The original bug report was that the Glossy Toon BSDF behaves incorrectly when mixed with other closures. The underlying issue here was that the eval function didn't check whether the reflection angle is inside the valid cone and always returned its PDF, which is very high compared to e.g. the diffuse closure's PDF for small sizes (since the cone is supposed to be quite tight) and therefore breaks MIS mixing. However, while looking into this, I found a number of other issues, and so this commit also contains several other changes to the Toon BSDFs: - The angle that was used to compute the intensity wasn't the actual angle between the vectors. From what I can see, the formula that was used goes back all the way to the initial commit 12 years ago, so this probably was something that happened to work with one particular cone sampling method. Now, however, it caused weird asymmetric highlights, so replace it with the actual angle (which we already compute anyways). - Setting size to zero caused the BSDF to go black, so clamp to 1e-5. - The code was overall a bit repetitive, so I've cleaned it up a bit. |
||
---|---|---|
.. | ||
atomic | ||
audaspace | ||
clog | ||
cycles | ||
dualcon | ||
eigen | ||
ffmpeg | ||
ghost | ||
guardedalloc | ||
iksolver | ||
itasc | ||
libc_compat | ||
libmv | ||
locale | ||
mantaflow | ||
memutil | ||
mikktspace | ||
opencolorio | ||
opensubdiv | ||
openvdb | ||
quadriflow | ||
renderdoc_dynload | ||
rigidbody | ||
sky | ||
utfconv | ||
wayland_dynload | ||
CMakeLists.txt |