Occlusion culling using ARB_occlusion_query

I’ve been considering methods for dealing with occlusion culling, never quite finding anything that runs fast enough or is dynamic enough for Minecraft.

I had given ARB_occlusion_query a shot before, but it ended up in a slight decrease in fps. But it SHOULD work, in theory.

So I threw caution out the window and started ripping through my chunk rendering code, and split it into two very similar code paths. One without occlusion queries, and one with. Here are the results when standing in a corner of the map and looking diagonally inwards with minimum fog (worst case):

Without occlusion queries (same as before): (131 fps)

image

With occlusion queries: (260 fps)

image

The downside is that if you move really fast, you can see an invisible chunk for a frame or two, but I think that’s worth the overall increase in framerate.
I over-estimate the bounding boxes of the chunks to minimize the risk of this, too.

Of course, one MAJOR concern is that ATi sucks. This might cause crash problems again, much like the VBO stuff I did before did (it’s disabled now)..

Also, on really old hardware, where this is needed the most, the extension isn’t available in the first place..

posted 14 years ago