The approach I used in this minecraft level renderer is essentially fluorescence filling. The 16x16x128 columns are divided into 16x16x16 chunklets, each with a VBO with corresponding geometry. I start a flood in the channlet grid in the player’s place to find chunklets for rendering. Filling is limited to:
- View frustum
- Solid chunklets - if the entire side of the chunklet is opaque, then the flood will not go into the chunklet in that direction
- Direction - the flood will not divert the direction, for example: if the current honker is located north of the starting fragment, do not flood in the chunklet to the south.
Everything seems to be working fine. I am on android, therefore, although more sophisticated analysis (anti-portals, as Mike Daniels noted), will select more geometry, I am already limited by the processor, therefore not so much.
I just saw your answer to Alan: culling is not your problem - this is what and how you send to OpenGL, which is slow.
What to draw: do not display a cube for each block, visualize faces of transparent blocks that border an opaque block. Consider a 3x3x3 cube of, say, stone blocks: there is no point in drawing a central block, because there is no way that the player can see it. Similarly, the player will never see the face between two adjacent stone blocks, so do not draw them.
How to draw: As Alan noted, use VBO for batch geometry. You won’t believe how much faster they do something.
A simpler approach with minimal changes to your existing code would be to use displayed lists . This is what minecraft uses.
ryanm
source share