how to calculate textures for a terrain?

how to calculate textures for a terrain?

Postby titi » 06 Dec 2009, 20:31

I'm currently reimplementing the game glest in java using the jmonkey engine.
I got a bit strucked now, because I complely don't know how the textures for the terrain are precalculated.

What i have in glest is a group of compatible and tiling textures for every sort of ground.
These groups are used randomly. With this i can easily setup the textures for the ground but glest does something more ...
if there are two different types of ground textures next to another the texture borders are shown some kind of smooth.

Now for my question:
How is something like this done in general? Is the texture for the whole ground one huge texture? Or is every tile bound to its texture coordinates and the fade out on the borders is done with a trick?

I also read something about "splatting" http://en.wikipedia.org/wiki/Texture_splatting
Is this the right way to go?
User avatar
titi
 
Posts: 50
Joined: 06 Dec 2009, 19:44

Re: how to calculate textures for a terrain?

Postby ghoulsblade » 06 Dec 2009, 20:57

depends on the game, but in the general wide area games i think a huge texture, overlaid by detail-textures is rather common.
interesting website on the topic : http://vterrain.org/
User avatar
ghoulsblade
Global Moderator
 
Posts: 138
Joined: 08 Nov 2009, 22:47

Re: how to calculate textures for a terrain?

Postby titi » 07 Dec 2009, 11:37

One huge texture is not possible in my case, it's too huge ( big maps would have a texture size of 768 MB! ).
I'm implementing soemthing using splatting now, lets see if this works. I will report my results.
User avatar
titi
 
Posts: 50
Joined: 06 Dec 2009, 19:44

Re: how to calculate textures for a terrain?

Postby titi » 15 Jun 2010, 10:30

Its a long time ago, but I forgot to post my results:
Texture splatting was the right keyword. Here is what I did:
http://www.jmonkeyengine.com/forum/inde ... ic=12729.0

( I don't work on this any more :( )
User avatar
titi
 
Posts: 50
Joined: 06 Dec 2009, 19:44

Re: how to calculate textures for a terrain?

Postby charlie » 15 Jun 2010, 11:24

How come you don't work on it anymore? It looked like you were making good progress. I guess you work on Mega Glest full time now.
Free Gamer - it's the dogz
Vexi - web UI platform
User avatar
charlie
Global Moderator
 
Posts: 2131
Joined: 02 Dec 2009, 11:56
Location: Manchester, UK

Re: how to calculate textures for a terrain?

Postby titi » 15 Jun 2010, 12:21

yes , time is limited and megaglest is in focus now :(
User avatar
titi
 
Posts: 50
Joined: 06 Dec 2009, 19:44

Re: how to calculate textures for a terrain?

Postby Julius » 15 Jun 2010, 13:56

Well Megaglest seems to make good progress however ;) I am definitely looking forward to a release with Masterserver support! Any plans to also update the GUI? It's pretty much the last part of Glest (after implementing proper multiplayer) which could really benefit from a mayor update (graphical but also froma userbility standpoint, e.g. tool tips etc).
User avatar
Julius
Community Moderator
 
Posts: 3297
Joined: 06 Dec 2009, 14:02

Re: how to calculate textures for a terrain?

Postby alapshin » 15 Jun 2010, 19:59

titi
Huge texture for the landscape is called "mega-texture approach" and it was developed by John Cormack in his Unreal engine if I'm not mistaken. This is not a general approach at all, but with some tricks provides very high details and no patterns of tiles.

As for general approach (my opinion):
1. Use shaders if possible. Provide them texture that defines how tile textures should be mixed and mixed them up in this way. For example you have rgb texture that defines how to mix textures (r + g +b = 1 for this map) and three tiles are set, so the result will be r * colorFromTexture1 + g * colorFromTexture2 + b * colorFromTexture3

2. If shaders are not available or shouldn't be used you may use "glColor" command and GL_MODULATE texture mapping mode to produce different smooth effects. Or some smooth effects can be made using multitexturing with different rules for mixing. I do not remember what commands of OpenGL sets multitexture mixing, cause I do not like this very old fixed-function pipeline style.

So, general appoach depends on your needs and target GPU capabilities :)
alapshin
 
Posts: 39
Joined: 28 Mar 2010, 12:09

Who is online

Users browsing this forum: No registered users and 1 guest

cron