Lately, I’ve been working on a 3D tile engine using Panda, and it’s finally gotten to a point that I’m feeling the urge to show off just a little.
There’s also a short YouTube video at: http://youtu.be/p2GT8jfWR-8
Now that the important part’s out of the way… the tile engine is written using Cython, and boy does that make a difference. Precalculating visible block faces literally became twenty times faster. Or more.
The tile engine generates geometry in chunks of 32x32x32 blocks (though the chunk size is controlled by a single definition and easily changed), and it has a few performance tricks. For one, it only creates two vertex buffers/writers/geom/geomnode sets for each chunk. One for blocks that are transparent, and one for those that aren’t.
Then, it combines faces when it can to reduce polygon count by a lot. Adjacent blocks of the same type will, generally, use just two polygons for a face. I’ve got those all in a GeomTristrips, though I haven’t tested to see if it performs better any other way. (I suspect it doesn’t.)
There are a few things left to code at this point, including a way to get it streaming only chunks around a given location, and some editing functions, but performance is looking pretty nice.
I’m planning to use this tile engine in an RPG creation system, similar to the RPG Maker series of applications.