GPULightmapper: increase ray triangle hit rate #53844
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.
Currently the method ray_hits_triangle determines triangles not to be hit by
a ray due to an epsilon that is too big. In practice those triangles are hit by
those rays.
This is fixed by introducing a smaller epsilon.
This fixes the leaks in the model of @jcostello (see below) given in #51638. Also notice that the shadow cast by the roof of the veranda was incorrect.
Before (Quality: medium; bounces: 0; denoiser: off)
![Screenshot from 2021-10-15 15-32-22](https://user-images.githubusercontent.com/10560119/137496350-ab514734-7af0-4228-a8f0-4909ec45c480.png)
After (Quality: medium; bounces: 0; denoiser: off)
![Screenshot from 2021-10-15 15-02-35](https://user-images.githubusercontent.com/10560119/137496370-a5cfb8c9-f16f-40f6-9689-6ce4e69d220d.png)