Question

I can't seem to find any tutorials or information on how to properly texture a terrain generated from a height map.

Texture mapping is not the problem, what I want to know is how to texture the entire terrain with difference elevations having different textures.

What I came up with was having a texture that looks like this:

enter image description here

Depending on the elevation of the triangle a different texture is assigned to it.

The result: enter image description here

What I'm trying to do is create an environment like skyrim, were textures don't need to repeat constantly, a convincing landscape!

The question is how do I create some thing like this: enter image description here

The textures blend together seamlessly at different elevations! How is this done? What is the technique used?

Example Video: http://www.youtube.com/watch?v=qzkBnCBpQAM

Was it helpful?

Solution

One way would be to use a 3D-Texture for your terrain. Each layer of the texture is a different material (sand, rock, grass for example). Every vertex has a third uv-component that specifies the blending between two adjacent textures, you could also use the height of the vertex here. Note that a blending between grass and sand in our example is not possible with this approach because rock 'lies in between', but it is certainly the easiest and fastest method. An other method would be to use individual 2-dimensional textures instead of a single 3D one. You would then bind the textures sand and grass for example and draw all vertices that need a blending between the two. Bind two other textures and repeat. That is certainly more complicated and slower but allows blending between any two textures. There might be more methods but these two are the ones I can think off right now.

Professional game engines usually use more advanced methods, I've seen designers painting multiple materials on a terrain like in photoshop but that's a different story.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top