blender/intern
Lukas Stockner 02a488d0fe Fix #61042: Cycles: Various Toon BSDF issues
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.
2024-03-24 23:52:16 +01:00
..
atomic Cleanup: move CMake test utility functions into testing.cmake 2024-01-03 14:49:11 +01:00
audaspace Cleanup: use braces for sources in intern/ 2023-09-17 09:05:40 +10:00
clog Revert changes from main commits that were merged into blender-v4.1-release 2024-02-19 15:59:59 +01:00
cycles Fix #61042: Cycles: Various Toon BSDF issues 2024-03-24 23:52:16 +01:00
dualcon Mesh: Rename MLoopTri variable names, and functions 2023-12-19 14:57:49 +01:00
eigen Cleanup: remove redundant define checks 2023-12-07 10:39:03 +11:00
ffmpeg Tests: add option to build one binary per GTest file 2024-01-03 18:35:50 +01:00
ghost Cleanup: Move remaining GPU headers to C++ 2024-03-23 01:24:18 +01:00
guardedalloc Fix #118402: enforce expected minimum alignment in MEM_CXX_CLASS_ALLOC_FUNCS 2024-02-21 18:14:11 +01:00
iksolver Clang Format: bump to version 17 2024-01-03 13:38:14 +01:00
itasc License Headers: Set copyright to "Blender Authors", add AUTHORS 2023-08-16 00:20:26 +10:00
libc_compat License Headers: Set copyright to "Blender Authors", add AUTHORS 2023-08-16 00:20:26 +10:00
libmv UI: fix and improve a few messages 2024-02-05 17:08:17 +01:00
locale License Headers: Set copyright to "Blender Authors", add AUTHORS 2023-08-16 00:20:26 +10:00
mantaflow Cleanup: Replace MIN/MAX macros with C++ functions 2024-01-22 15:58:18 +01:00
memutil Cleanup: use braces in headers 2023-09-24 14:52:38 +10:00
mikktspace Cleanup: use braces in headers 2023-09-24 14:52:38 +10:00
opencolorio Cleanup: Move remaining GPU headers to C++ 2024-03-23 01:24:18 +01:00
opensubdiv Cleanup: Remove unnecessary keywords from C++ headers 2024-01-04 15:07:48 -05:00
openvdb Volumes: refactor volume grid storage 2023-12-20 15:32:52 +01:00
quadriflow Cleanup: Replace MVertTri type with C++ vector 2023-12-20 20:59:11 -05:00
renderdoc_dynload RenderDoc: Set Capture Title 2024-02-23 10:57:37 +01:00
rigidbody Clang Format: bump to version 17 2024-01-03 13:38:14 +01:00
sky License Headers: Set copyright to "Blender Authors", add AUTHORS 2023-08-16 00:20:26 +10:00
utfconv CMake: Fix Compiling Shader Builder on macOS 2023-12-08 15:47:14 +01:00
wayland_dynload Fix #115878: build error with LIBDECOR & WITH_GHOST_WAYLAND_DYNLOAD=OFF 2023-12-13 10:17:07 +11:00
CMakeLists.txt CMake: Fix Compiling Shader Builder on macOS 2023-12-08 15:47:14 +01:00