Tiled terrain

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
eejin
Posts: 97
Joined: Sun Jul 24, 2011 11:50 am

Tiled terrain

Post by eejin »

Hi,
I've been trying to create a tiled terrain by which I mean something like this:
Image
Now as you see there are multiple textures on a terrain and they all blend nicely.
Textures are assigned to tile and then are blended with nearby tiles.

Now I'm trying to recreate this using Irrlicht.
What would be the best way to do this?

Thanks in advance.
MrGuy
Posts: 18
Joined: Mon Oct 29, 2012 11:05 pm

Re: Tiled terrain

Post by MrGuy »

Multilayer splatting for example.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Tiled terrain

Post by hendu »

The pic you posted is pretty clearly artist-made 2d art combinations, no algorithm.

They have drawn each combination for each place.
gerdb
Posts: 194
Joined: Wed Dec 02, 2009 8:21 pm
Location: Dresden, Germany

Re: Tiled terrain

Post by gerdb »

hi,

there are many approaches,

the modern ways are with multitexturing ( one layer for dirt, one layer for grass with an alpha component saying where grass is fully visible or not, or in between ) and shaders,
the old way ( which uses only one texture stage ) creates a texture atlas with all combinations of border tiles from 2 or more textures.
eejin
Posts: 97
Joined: Sun Jul 24, 2011 11:50 am

Re: Tiled terrain

Post by eejin »

Can the multitexturing way support more than 4 types of terrain. I need more than grass, dirt and some others.
Won't this method also create very large filesizes because you need a full scale alpha map for every layer?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Tiled terrain

Post by hendu »

Yep, use an atlas. Then you can have 2^32 tiles.
CuteAlien
Admin
Posts: 9670
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Tiled terrain

Post by CuteAlien »

One layer per tile. You probably won't need more than 4. The point is just that you don't create combinations for each border, but instead you can can for each terrain-type just have border-tiles (which are independent of the terrain-type with which they combine). You still need for each tile several variations. And then you draw them in a certain order (dirt first and then gras on top for example).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
MrGuy
Posts: 18
Joined: Mon Oct 29, 2012 11:05 pm

Re: Tiled terrain

Post by MrGuy »

If you have textures that cant ever mix like grass and stone you can pack those in the same layer with different colors so the shader can decide which texture to use. That way you reduce the amount of layers needed.
But with half way modern hardware thats not needed. I have the crappiest hardware ever (well no. But a laptop with an ATI Graphics 3100 ... Not even ATI wants to know that thing. There are no drivers, no nothing. They act like "Wut? Thats not of us. We would never produce such poop!" )and splatting is no problem... :)
Post Reply