-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
CPU Frustum Culling #1333
Comments
This is something I'm interested in working on, as I've been doing similar things for ray cast picking. To be upfront - if I did work on this, I would need some guidance when it comes to integrating with the renderer. Edit: Some good reference material:
Edit 2021/02/08 I've started working on a bounding box plugin as a prerequisite for this work. It appears that to make progress on this task, we need:
One of the nice things I'm finding so far is that it's relatively painless to make bounding volumes generic over a few types (bsphere, aabb, obb). Updating existing bounding volumes can make use of change detection. Constructing and updating a scene graph is an open question, I'm not familiar with the best way of grouping mesh entities in a graph. I can see a few potential approaches:
As for frustum culling, this is a good reference: http://www.cse.chalmers.se/~uffe/vfc.pdf I think to start, flipping the |
bevy.2021-02-22.22-54-36_Trim.mp4I have a functioning CPU frustum culling plugin here: https://github.com/aevyrie/bevy_frustum_culling This relies on the bounding plugin here: https://github.com/aevyrie/bevy_mod_bounding This does not use a scene graph or any sort of BVH, instead, it simply runs culling in parallel with a In this contrived stress test with 64,000 water bottle meshes, I see an improvement of: |
Implemented by #2861 🎉 |
What problem does this solve or what need does it fill?
Frustum culling is a pretty simple optimization where you put bounding volumes on your meshes and if a volume doesn't intersect the view frustum, you don't issue a draw call for that mesh. This saves a lot of vertex shader calls that would do culling on the GPU.
What alternative(s) have you considered?
This is a pretty standard feature for a renderer. I'm not aware of any better alternatives.
The text was updated successfully, but these errors were encountered: