0

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

Aᴍɪʀ
  • 7,623
  • 3
  • 38
  • 52
Anthony Raimondo
  • 1,621
  • 2
  • 24
  • 40
  • 1
    Please [edit] your question to show [what you have tried so far](http://whathaveyoutried.com). You should include a [mcve] of the code that you are having problems with, then we can try to help with the specific problem. You should also read [ask]. – Toby Speight Jan 31 '17 at 17:58

1 Answers1

3

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.

Marius
  • 2,234
  • 16
  • 18
  • yes 3d texturing looks like the way to go for now, just wondering, can i still normal map a 3d texture? – Anthony Raimondo Oct 24 '13 at 20:13
  • Of course you can. J̶u̶s̶t̶ ̶m̶i̶x̶ ̶t̶h̶e̶ ̶'̶n̶o̶r̶m̶a̶l̶ ̶c̶o̶l̶o̶r̶'̶ ̶a̶s̶ ̶y̶o̶u̶ ̶w̶o̶u̶l̶d̶ ̶d̶o̶ ̶w̶i̶t̶h̶ ̶y̶o̶u̶r̶ ̶a̶l̶b̶e̶d̶o̶.̶ Actually the 3d-texture fetch operation does that for you. – Marius Oct 24 '13 at 20:29