Terrain screenshots

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:

http://statezero.net/terrainshots/

Looks good.

Feel free to submit a screenshot :wink:

Very nice. I am also fighting with terrain engine ;). I suppose that you are render triangles, not triangle_strip, because of LOD ? Do you have frustum culling part of optimisation, too?

Very nice indeed.

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.

Seems that texturing is not affected by LODing? Thats fine (I consider this difficult, is it)?

Can you still have a chep-to-compute getHeight(x,y) method?

How is it implemented? Java3D? JOGL? Xith? JME?