Applying texture on terrain nesh.

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
Wodzu
Posts: 27
Joined: Wed May 07, 2014 5:41 pm

Applying texture on terrain nesh.

Post by Wodzu »

Hi guys.

I have a problem with understanding how to achieve good results (for the eye) when applying texture on a terrain mesh. I know what U-V coordinates are and I know how to apply texture to mesh.
It is hard for me to explain what I do not understand ;) so I will try to show it on an example. I've found very nice article here: http://www.adriancourreges.com/blog/201 ... hics-study
which explains how a terrain and textures has been created.

Firstly we have a terrain:

Image

And then we have applied texture:

Image

On the second image you can see the line where grass meets with sand. This line is very irregular, it looks natural. However the underlying mesh does not have its veritces at the exact place where the "grass line" is visible. Does it mean that the whole texture has been precomputed in memory (combined from few textures by texture splatting) and then, this one single texture has been applied to the mesh? Article says that the heightmap for terrain is 513x513 so I assume that the used texture is 512x512. So texture with this size has been stretched on a terrain with size 10x10 km.

Is my assumption correct and this is how its done?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Applying texture on terrain nesh.

Post by hendu »

Yes, texture splatting is common. Other approaches calculate the textures dynamically, for example by the height from sea level.
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Re: Applying texture on terrain nesh.

Post by Seven »

there is a 6 texture triplaner shader example somewhere on the forum that we use with very nice results.
Wodzu
Posts: 27
Joined: Wed May 07, 2014 5:41 pm

Re: Applying texture on terrain nesh.

Post by Wodzu »

And what should I do if I have a very large terrain? I understand that I need to have smaller textures. For example instead of 1024x1024 texutre I am splitting it to four 512x512 textures. But how I can apply them to my mesh? Like in the example:

Image

The problem is that some of the triangles are sharing more than one texture so it is not possible to generate UV coorinates?
What is the best way to solve this problem?
Post Reply