Not a game demo really, just some screenshots from a terrain patch renderer I’m working on.
The terrain is specified in the form of a greyscale heightmap, a RGB colormap that maps to the whole patch, a series of textures, and a series of 1 channel alpha masks for the aforementioned textures. Right now it renders in fixed function with 1 pass per texture, plus 1. My little screenshots are using a series of 2 textures (grass and rock), so it is 3 passes.
There is only 1 unique patch but it is instanced 4 times and rendered seamlessly side by side in a 2x2 grid. I wrote a tesselator to tesselate the incoming regular heightmap. I run the tesselator several times in series (in my case, 4) to generate LOD meshes for the terrain. Each patch LOD shares the same VBO but uses different indices.
My mesh is 4225 verts raw, tesselated to 2673 (5088 tris) then LOD’ed down to 1602, 967, 540, etc… verts.
I’m pretty sure I can do the whole thing in 1 rendering pass using a pixel shader. Another optimization to be made is to take the meshes, and divide them into smaller meshes for each texture. E.g. for each texture, iterate the mesh. If any of the points on a triangle map to a non-zero value in the texture mask, this triangle goes into the mesh for this texture.
Anyway, here’s some screenshots. I didn’t want to shrink them down, so follow this link to see the rest: