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.

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:

Yes I do triangle list, not strip. Each patch of terrain is a single list of triangles, so that is the level of geometry that gets frustum culled. My next step is to divide the patch into multiple lists based on the texturing. I need 1 list per texture configuration. For my 2 textures, A & B, I have triangles with only texture A, only texture B, or with both A & B blended. So I would split my mesh into 3 lists. For 3 textures, there are 7 combinations, and so on.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org