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

Oriented Bounding Box frustum check is too loose #4387

Closed
lilleyse opened this issue Sep 29, 2016 · 7 comments
Closed

Oriented Bounding Box frustum check is too loose #4387

lilleyse opened this issue Sep 29, 2016 · 7 comments

Comments

@lilleyse
Copy link
Contributor

The current OBB vs plane algorithm is an approximation that works best with more evenly-sized dimensions. As a result we sometimes see results like below, which cause tiles to be selected that aren't actually visible.

image

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 27, 2016

To improve this:

  • Double check that OrientedBoundingBox.intersectPlane is correct. It probably is, and the screenshot above is probably because the view frustum is huge and this is the classic problem where the bounding volume is outside at the frustum corners but the algorithm still reports "intersecting."
  • Try Correct Frustum Culling. After the 6 plane test reports intersecting, test all the corners of the frustums against each of the planes of the bounding volumes.
    • Note that the larger the bounding volume (which is common in Cesium terrain and 3D Tiles), the more likely the plane test is to return a false intersection so I suspect these extra checks will more than pay for themselves in fewer draw calls.
    • Given the increase cost, Fewer plane checks in frustum test #4787 could be a big win.
  • Implement for both OBBs and spheres, and profile for both terrain and 3D Tiles.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 30, 2016

Above, note that when adding IQ's tests, all 6 planes in the orignial algorithm do not need to be checked. Just two corners are "created" and tested.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 30, 2016

Reminder to let @erich666 know our results.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jan 30, 2017

@austinEng are you able to reproduce the exact case shown in the screenshot above? I believe the camera is just west of the initial tileset in the Sandcastle example and looking straight down. Or was this another bug?

@austinEng
Copy link
Contributor

I was not. @lilleyse said that he thinks this specific problem was already solved in another bugfix

@lilleyse
Copy link
Contributor Author

The screenshot was taken before the box debug outlines were fixed #4845. Therefore our tilesets just don't have tight fitting bounding boxes, which the 3d-tiles-tools generator will address.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jan 30, 2017

OK, thanks for investigating.

@pjcozzi pjcozzi closed this as completed Jan 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants