Update self-shadowing function for direct lighting #12063
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR updates the geometric shadowing function used for direct lighting in physically-based rendering.
Our existing code was using a Schlick-Smith approximation. The limitations of this approximation have been explained by Eric Heitz in a 2014 paper. This PR updates the approach to follow the recommendations of the paper, using code similar to the glTF Sample Viewer.
The effect of the change is subtle, but it makes specular reflections slightly brighter on models with medium roughness.
Issue number and link
Resolves #12010.
Testing plan
Load the glTF PBR Sandcastle, and select the lighting option "Direct Lighting Only". See especially the "Metal-Roughness Spheres" model. Compared to the same Sandcastle in main, the specular reflection should be slightly brighter and broader in this branch.
Author checklist
CONTRIBUTORS.md
CHANGES.md
with a short summary of my change