Planet/Sphere culling

Started by
1 comment, last by Ruggostein 12 years, 4 months ago
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.
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
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:

This topic is closed to new replies.

Advertisement