Perform server occlusion culling as spatial and temporal sampling #14186
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.
This changes the current occlusion culling to a sampling approach.
Sampling is spatial, in that it sends a couple of rays to a random point inside the target block.
Sampling is also temporal in each round of going through map send cycle another rays is sent.
Goal of the PR
Improve both performance and accuracy of occlusion culling. Remove the hack that requires encountering two solid nodes before declaring a block invisible - not needed with the sampling.
How does the PR work?
Instead of a fixed set of culling rays, send a set of random rays.
Does it resolve any reported issue?
No. Although sometimes we complain about occlusion culling being inaccurate.
Does this relate to a goal in the roadmap?
No
If not a bug fix, why is this PR needed? What usecases does it solve?
To do
This PR is Ready for Review (and for Testing)
How to test
Load any world. Set a large viewing_range (like 1000), and observe how the world is loaded.
Notice that blocks near-by are culled fairly accurately, whereas in the distance some "holes" are visible that filled in over time.
Whether this is annoying or not is subjective, so please test and let me know.