Terrain: doing a pitch

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
cyberpunkpor
Posts: 9
Joined: Thu Oct 25, 2007 10:03 am

Terrain: doing a pitch

Post by cyberpunkpor »

Hi.

I am starting learning the framework and i face a problem when rendering a terrain. I want a terrain like a football pitch with different textures and patterns. Is it possible to build a terrain like that?

So far i am building a normal terrain with a specific heighmap and a texture:

http://img252.imageshack.us/my.php?image=smokepp9.png

Any help would be appreciated.

Thanks,

cyber
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

nice stadium !!! :)
but is it realy necessary to use a terrain for this ??? :shock:
I think a simple quad with a nice texture would be enough, wouldn't it ???
or you could create it directly with the stadium as one part...
(at least I would do it this way)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
cyberpunkpor
Posts: 9
Joined: Thu Oct 25, 2007 10:03 am

R

Post by cyberpunkpor »

Hi. Thanks for the replay.
I thought that using a terrain i could have more flexibility to create different types of grass.
I will try to search about quad's. thanks.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

well, with the terrain node you could do a football pitch with many impact holes in the ground... :lol:
I think a simple cube scene node would be a good idea or maybe a simple sqare build out of 4 vertices...

but how you thought to do diferent grass types ???
do you want to make real grass or simply change diferent textures ???
but in either case a terrain node wouldn't be a good idea for this... ;)
for real grass there is a grass scene node avilable in the code snippets forum, http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=10762
but I think it's not realy good for performance to use real grass for the field...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
cyberpunkpor
Posts: 9
Joined: Thu Oct 25, 2007 10:03 am

Post by cyberpunkpor »

hi

thanks again for replying.

I want to do something like this:

http://www.clarkcompanies.com/Site%20Re ... 0Field.jpg

With a tiled texture. One tile with a texture and other tile with other texture.

This is for now, but in the future it could have, for example, near the goalkeeper a worst grass or if it is raining the grass can be more darken.

I already saw the grass node. its great but i just want to have a node that i can draw with different textures in a plain.

Thanks
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

ahh, yes, nice idea !!! :)

you could do this with shaders, or maybe with texture blending...
unfortunatly I didn't use shaders until now (had no need of them, yet), so maybe someone with more experience with shaders can help you with this then... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You still don't need more than one texture and a simple plane. All things can be added to that one texture.
krama757
Posts: 451
Joined: Sun Nov 06, 2005 12:07 am

Post by krama757 »

Yea, a simple quad should be enough.

Then for the texture you can do one of the following things:
Make one large texture
Make a small repeatable tile and set texture coordinates
Make 2 separate textures with repeating white/grass color bands and make the white transparent using makeColorKeyTexture(). Then change the texture coordinates while adding them in-game so that it looks like it is tiled.
cyberpunkpor
Posts: 9
Joined: Thu Oct 25, 2007 10:03 am

Post by cyberpunkpor »

Thanks all for helping out.

I will try it out and report some feedback.
cyberpunkpor
Posts: 9
Joined: Thu Oct 25, 2007 10:03 am

Again..

Post by cyberpunkpor »

I am bringing again this topic to show the work so far:

Image

What i am doing:

- I create a custom scene node
- then i have a method that generate the custom scene node with the tile size
and texture i want giving the aspect that is shown in the image.
- i end up with multiple nodes all being dumped on the surface.

I think it would be better and faster using other strategy:

- create a quad with multiple tiles
- each tile (part of the quad) will be mapped with a specific texture (a file)
- make the white lines (I don't know how to make this.. perhaps with some
transparent effect?)

Can you point me some samples/pseudo-code/code/articles that explains how to do this second strategy? It can be opengl or directx samples.

Thanks a lot.

cyber
Ico
Posts: 289
Joined: Tue Aug 22, 2006 11:35 pm

Post by Ico »

I'd try this way:

Use one big quad with 2 material layers (maybe more quads depending on your intended detail level and texture size).

Material 0: Grass/ground (shader material)
Material 1: Lines (drawn once to a texture or loaded from file unsing an alpha channel)

The shader material enables you to mix different textures (i.e. mud holes, different colors of grass, normal mapping, etc.) and it won't need one huge texture or tons of texture tiling.
Post Reply