Significantly improves the performance of occlusion search, with particularly noticeable gains at large render distances, or when async occlusion is disabled.
Summary of changes:
Frustum tests are now memoized across the whole region where possible. Specifically, the region's bounding box is evaluated for being fully inside/fully outside/partially inside the frustum, and the first two cases are used to skip the per-section test entirely.
The occlusion graph data structures have been completely reworked, and now use flat arrays rather than a Java object per node. This drastically reduces the amount of pointer chasing and cache misses during the graph traversal.
Some metadata on render sections has been packed into a bitfield rather than stored as individual fields, which allows it to be efficiently cached in the occlusion graph, for similar reasons to above.
In general much of the occlusion culling code is a lot more C-like, e.g. some queues were replaced by plain arrays with pointer bumping.
AI disclosure: These improvements were made with assistance from Claude Fable 5 & Opus 5 (design details), Opus 4.8 (final production implementation), and GPT-5.6-Luna (most docs). The added lines of code look quite concerning, but most are from the newly added comments. With comments & blank lines excluded, the PR works out to roughly 620 lines added and 310 removed.
Performance figures: A draft implementation (separate codebase from the one on this branch) written by the Fable/Opus team and tested in isolation on an i5-1135G7 system yielded ~60-74% reduction in CPU time spent on occlusion culling. When testing the final implementation on my main PC (Ryzen 7 7700X, RX 6600) the game now remains GPU-bound at a render distance of 64 when shaking the camera (while otherwise remaining still, to avoid overhead from chunk loading/unloading).
Significantly improves the performance of occlusion search, with particularly noticeable gains at large render distances, or when async occlusion is disabled.
Summary of changes:
- Frustum tests are now memoized across the whole region where possible. Specifically, the region's bounding box is evaluated for being fully inside/fully outside/partially inside the frustum, and the first two cases are used to skip the per-section test entirely.
- The occlusion graph data structures have been completely reworked, and now use flat arrays rather than a Java object per node. This drastically reduces the amount of pointer chasing and cache misses during the graph traversal.
- Some metadata on render sections has been packed into a bitfield rather than stored as individual fields, which allows it to be efficiently cached in the occlusion graph, for similar reasons to above.
- In general much of the occlusion culling code is a lot more C-like, e.g. some queues were replaced by plain arrays with pointer bumping.
AI disclosure: These improvements were made with assistance from Claude Fable 5 & Opus 5 (design details), Opus 4.8 (final production implementation), and GPT-5.6-Luna (most docs). The added lines of code look quite concerning, but most are from the newly added comments. With comments & blank lines excluded, the PR works out to roughly 620 lines added and 310 removed.
Performance figures: A draft implementation (separate codebase from the one on this branch) written by the Fable/Opus team and tested in isolation on an i5-1135G7 system yielded ~60-74% reduction in CPU time spent on occlusion culling. When testing the final implementation on my main PC (Ryzen 7 7700X, RX 6600) the game now remains GPU-bound at a render distance of 64 when shaking the camera (while otherwise remaining still, to avoid overhead from chunk loading/unloading).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Significantly improves the performance of occlusion search, with particularly noticeable gains at large render distances, or when async occlusion is disabled.
Summary of changes:
AI disclosure: These improvements were made with assistance from Claude Fable 5 & Opus 5 (design details), Opus 4.8 (final production implementation), and GPT-5.6-Luna (most docs). The added lines of code look quite concerning, but most are from the newly added comments. With comments & blank lines excluded, the PR works out to roughly 620 lines added and 310 removed.
Performance figures: A draft implementation (separate codebase from the one on this branch) written by the Fable/Opus team and tested in isolation on an i5-1135G7 system yielded ~60-74% reduction in CPU time spent on occlusion culling. When testing the final implementation on my main PC (Ryzen 7 7700X, RX 6600) the game now remains GPU-bound at a render distance of 64 when shaking the camera (while otherwise remaining still, to avoid overhead from chunk loading/unloading).