Add epsilon to section distance check #2823
Open
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 is done to for parity with the epsilon used on frustum culling.
The epsilon is pretty pessimistic, and can be less pessimistic if the algorithm is changed slightly. I chose not to do this because it may make the function slower.I chose not to add this value to thesearchDistance
value provided toOcclusionCuller.findVisible
, because that could potentially change the sections traversed by the BFS, which I'm not sure we want.The epsilon used for this function is
1.0
on each axis, enough to account for large block models, while the the frustum cull uses1.125
. The extra0.125
exists in the epsilon of the frustum cull due to floating point imprecision, which shouldn't come up with the minimal amount of floating point operations in the distance check.With this used, I think the
+ 0.5
epsilon here may be able to be removed, also. I need confirmation on this to be sure.