blender/intern
Sebastian Herholz fbc884d2a8 Ensure BSDF evals and pdfs are zero on invalid samples
Currently, the `eval` and `pdf` are not explicitly set to zero when a BSDF sample is invalid (e.g., below the upper hemisphere), when calling
`bsdf_sample` or `bsdf_eval`. It is assumed that `eval` and `pdf` are set to zero before these functions are called, which can cause problems if not.

This patch fixes this potential problem by explicitly setting `eval` and `pdf` to zero when the sampled direction is invalid.

I also added a sanity check if `eval` and `pdf` are valid (i.e., >= 0.f).
The check is activated when build in debug mode and with the `WITH_CYCLES_DEBUG` set to `ON`.

Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D14776
2022-04-28 18:14:06 +02:00
..
atomic Cleanup: correct unbalanced doxy sections 2022-03-15 17:29:54 +11:00
audaspace File headers: manually convert files to use SPDX headers 2022-02-11 15:15:49 +11:00
clog File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
cycles Ensure BSDF evals and pdfs are zero on invalid samples 2022-04-28 18:14:06 +02:00
dualcon Cleanup: Compilation warnings 2022-03-18 12:07:08 +01:00
eigen File headers: manually convert files to use SPDX headers 2022-02-11 15:15:49 +11:00
ffmpeg Merge branch 'blender-v3.1-release' 2022-02-22 17:34:07 +01:00
ghost Cleanup: spelling in comments 2022-04-20 10:41:31 +10:00
glew-mx File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
guardedalloc Cleanup: Deprecated field access in outliner_duplicate 2022-03-16 12:38:23 +01:00
iksolver Cleanup: use M_PI_2 and M_PI_4 where possible 2022-03-11 18:27:58 +01:00
itasc Cleanup: remove argument to doxygen \file 2022-03-25 12:10:30 +11:00
libc_compat File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
libmv File headers: add missing copyright, add MIT to SPDX licenses 2022-02-11 14:56:03 +11:00
locale File headers: add missing copyright, add MIT to SPDX licenses 2022-02-11 14:56:03 +11:00
mantaflow Cleanup: Compilation warnings 2022-03-18 12:07:08 +01:00
memutil File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
mikktspace Mikktspace: Reduce number of data queries to caller 2022-04-23 15:09:41 +02:00
opencolorio Fix OpenColorIO error with configs using <USE_DISPLAY_NAME> 2022-04-11 20:10:42 +02:00
opensubdiv Revert "Fix GPU subdivision: Crash on adding subdivision surface modifier" 2022-04-20 21:32:03 +02:00
openvdb File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
quadriflow File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
rigidbody Cleanup: Further use of const for object bounding boxes 2022-04-01 18:30:09 -05:00
sky File headers: manually convert files to use SPDX headers 2022-02-11 15:15:49 +11:00
utfconv Cleanup: use C++ comments for disabled code 2022-04-13 13:47:04 +10:00
CMakeLists.txt File headers: SPDX License migration 2022-02-11 09:14:36 +11:00