Sign in to follow this  
Zaph-0

Basemap generation for Terrain.

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 this post


Link to post
Share on other sites
Quote:
Original post by Zaph-0
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.
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this