Fix: EEVEE: Incorrect GGX BRDF pdf and BTDF evaluation #111591

Merged
Clément Foucault merged 4 commits from weizhen/blender:fix-eevee-bsdf into main 2023-08-27 20:51:41 +02:00

4 Commits

Author SHA1 Message Date
Weizhen Huang 0ebf6ebb87 Fix implicit bool to float conversion 2023-08-27 19:30:58 +02:00
Weizhen Huang 6dfca6ac45 Use `saturate()` instead of `max()` when no division is needed
because the former is faster
2023-08-27 18:39:15 +02:00
Weizhen Huang cfe086ee13 Add comment regarding negated `L` 2023-08-27 18:37:09 +02:00
Weizhen Huang 4a9746f57f Fix: EEVEE incorrect GGX BRDF pdf and BTDF evaluation
* Using standard NDF and Smith shadowing-masking terms. The previous
`xxxx_opti()` functions were faster to evaluate, but confusing and
error-prone.
* After correcting the BRDF pdf, the prefiltered environment LOD bias
needs to be adjusted to avoid overblurred reflections.
* Corrected the half-vector computation in BTDF evaluation, added check
for invalid configuration due to total internal reflection or `eta == 1`.
2023-08-27 18:26:08 +02:00