• Advertisement
Sign in to follow this  

Planet/Sphere culling

This topic is 2267 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to render a planet, and I'm having some problems.
I have the planet geometry divided in chunks (I have the base planet mesh, then 4 subdivisions, then 4 subdivisions of those and so on)
Now I need to select which chunks should actually be rendered.
My first approach was to just use naive frustum culling, starting from the base mesh, and recursively test for each child.
This does not work though, as I'm using bounding boxes for testing each chunk, and since most of the terrain parts are curved surfaces, there's lot of empty space in the AABBs, which results in lots of false positives.
If I zoom into the surface, only 3 or 4 chunks should be visible, but instead, about 60% of the planet is rendered (at the first I though it was an error in my calculations, but I checked this using a debug camera, and it is indeed culling, but only a small part, due to the large bboxes).
I also tried to project the boxes into screen space and test for percentage of the rects on the screen, but of course, this does not work.

Any other suggestion?
How to get a proper chunk selection?

PS: The only other optimization I have right now is to ignore chunks that lie on the oposite side of the globe (right now I handle this by comparing the terrain "normal" and doing a dot product with the camera view), but this is irrelevant for the chunk culling.

Share this post


Link to post
Share on other sites
Advertisement

I'm trying to render a planet, and I'm having some problems.
I have the planet geometry divided in chunks (I have the base planet mesh, then 4 subdivisions, then 4 subdivisions of those and so on)
Now I need to select which chunks should actually be rendered.
My first approach was to just use naive frustum culling, starting from the base mesh, and recursively test for each child.
This does not work though, as I'm using bounding boxes for testing each chunk, and since most of the terrain parts are curved surfaces, there's lot of empty space in the AABBs, which results in lots of false positives.
If I zoom into the surface, only 3 or 4 chunks should be visible, but instead, about 60% of the planet is rendered (at the first I though it was an error in my calculations, but I checked this using a debug camera, and it is indeed culling, but only a small part, due to the large bboxes).
I also tried to project the boxes into screen space and test for percentage of the rects on the screen, but of course, this does not work.

Any other suggestion?
How to get a proper chunk selection?

PS: The only other optimization I have right now is to ignore chunks that lie on the oposite side of the globe (right now I handle this by comparing the terrain "normal" and doing a dot product with the camera view), but this is irrelevant for the chunk culling.


I use the recursive AABB test you mentioned and it works well for me. Perhaps your chunks are just too big? If they aren't very detailed perhaps you don't much culling..

You can also try Horizon culling(see here), I use this also, but at least for my app, it doesn't improve performance as much as just plain old frustum culling.

Another thing that made a huge difference in my app was occlusion culling, but I have 1000's of chunks visible at any given instance. With OC I can go from drawing 5,000 to only 1,000

Share this post


Link to post
Share on other sites
I've thought about using occlusion culling, but since I'm using Unity it does not offer a way to do that.
Hmm, so you say just AABB frustum culling works for you, maybe I have some error in my code, I will check it :wink:

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement