# Basemap generation for Terrain.

This topic is 3748 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, as the thread-title already says, I am interested in creating a basemap for my terrain with different textures and a heightmap. So far I thought about using the degree of the angle between vertices and the height of the vertice itself as criteria for the texture to use. Are there any other things to take into consideration ? Any advice (and maybe a link or screenshot :-) would be greatly appreciated... ^_^

##### Share on other sites
Here are a couple of links (though they are old):

One
Two

Also, although it's not really a texture generation method, you might want to look at texture splatting.

[Edited by - Gage64 on August 15, 2008 1:28:09 PM]

##### Share on other sites
Quote:
 Original post by Zaph-0as the thread-title already says, I am interested in creating a basemap for my terrain with different textures and a heightmap. So far I thought about using the degree of the angle between vertices and the height of the vertice itself as criteria for the texture to use.
I have used this scheme, and it works pretty well, although I used a few enhancements. You can in fact do this per-pixel, entirely in the shader - take a look at Ysaneya's Journal for details.

It is easiest to calculate the angle instead as the dot product between the terrain normal and the vertical, i.e. dot(n, (0,1,0)).

Then you probably want to add some noise to both the height and the angle, because otherwise the transitions are very sharp. If you are doing this in a shader, you can use a small texture filled with several octaves of perlin noise.

Lastly, use the height and angle values (after adding noise) to lookup a value in a 2D-lookup table (as another texture/image), which contains the id of the texture to use. This lets you tweak the look of the terrain just by changing an image, rather than having to work on a complex algorithm.

1. 1
Rutin
42
2. 2
3. 3
4. 4
5. 5

• 9
• 27
• 20
• 14
• 14
• ### Forum Statistics

• Total Topics
633387
• Total Posts
3011607
• ### Who's Online (See full list)

There are no registered users currently online

×