Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm trying to figure out the best way to programmatically represent terrain in my game. I've been considering using a heightmap (or grid of evenly spaced vertices) to represent the surface of the terrain and a splatmap to allow smooth texturing. This would work for totally smooth terrain, but the problem is how to represent cliffs and sharp cliff faces.

The cliffs themselves would need to be rendered differently than the rest of the terrain. For example, they would need to have a different (non-stretched) texture visible on the front of the cliff, but if I used the splatmap for this, it would be impossible to have a sheer enough cliff face where the texture of the cliff is totally separate from the ground.

A picture says a thousand words so...

enter image description here

What are some general ways to store and/or render cliffs and other sharp differences in terrain height?

share|improve this question
4  
You'll notice that very few games actually have truly vertical cliffs, they all slant by at least one grid's unit from top to bottom. Rendering can be done with splat map shaders that take that slope into account and pull from a sideways-wall texture. Blocks like in your picture are dropped in as geometry on top of the heightmap to give local flavor. –  Patrick Hughes Feb 17 '12 at 1:31
add comment

1 Answer

up vote 5 down vote accepted

That picture looks like they are using an extra prop to create the cliff. If you want to use a plain height map to represent your terrain, this is pretty much the only solution. The good news is it is commonly used and works fine. The simplest solution (from a programming perspective) is to just place extra props as needed in the level editor. If you want to get fancy, you can have a tool that automatically selects from a set of props and shapes the terrain to match.

You could provide a facility to extrude faces on the height map, which will get you perfect vertical faces with just a little bit of extra complication, but that is not likely to look very good and will probably require the placement of some extra decoration anyway to cover up the hard edge.

The last option would be to forgo a height map all together and just make your terrain a full piece of geometry, but then you lose the nice simplicity of a height map.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.