Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add epsilon to section distance check #2823

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

burgerindividual
Copy link
Contributor

@burgerindividual burgerindividual commented Oct 19, 2024

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 the searchDistance value provided to OcclusionCuller.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 uses 1.125. The extra 0.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.

@douira
Copy link
Collaborator

douira commented Oct 19, 2024

I think this culls less than it should, because models can't be as big as a sphere enclosing a 3x3x3 box, rather they can at most be a 3x3x3 box.

The .125 epsilon for floating point error is likely unnecessary for this comparison, unlike the frustum cull.
Copy link
Collaborator

@douira douira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@douira douira added the T-bug Type: Bug label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants