diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2024-07-03 18:31:07 -0700 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2024-07-03 23:53:24 -0700 |
commit | 4e9e35b58a5f6ddc25e7de5c93b351f574e50468 (patch) | |
tree | c6767761db37e51ea82539b035cb86cd24599150 /platform/linuxbsd/wayland/wayland_thread.cpp | |
parent | cae2f853dcd1ecc26ca68de08cec62089dee1f26 (diff) | |
download | redot-engine-4e9e35b58a5f6ddc25e7de5c93b351f574e50468.tar.gz |
Fix AABB computation for position compression to not depend on vertex order
The previous computation was dependent on the vertex order in two ways:
- If the first vertex was on the AABB boundary, the AABB would be
increased by the epsilon due to size clamping
- Every time the AABB would get expanded, we would recompute end from
size and reconstruct size again, which resulted in slow floating point
drift.
In isolation this may not seem like it matters, but it means that the
same mesh with a different vertex order may result in a slightly different
AABB. This can be a significant issue due to shadow meshes and their use in
depth prepass: shadow meshes reorder vertex data as part of the
deduplication process, as they append one unique position at a time and
as such remove the duplicate positions; this can result in a different
AABB which would result in a different reconstructed vertex position
during a depth pre-pass, causing mesh self-occlusion.
Diffstat (limited to 'platform/linuxbsd/wayland/wayland_thread.cpp')
0 files changed, 0 insertions, 0 deletions