Page 8 of 23

Posted: Tue Jul 17, 2007 12:57 pm
by varholl
One Question... yesterday i was testing the terrain.. it works awesome.. so i've started to build my world... i need to add some water... because there is the coast of the sea.. and a long river to the final mountains..

The only way i figure out how to do this.. was creating a mesh with the same size of the terrain... (believe me... it's huge) it worked.. but i don't know if there are better ways to do this.. maybe not rendering the entire mesh... i don't know... Someone Knows how to do this??

Thanks

Posted: Tue Jul 17, 2007 4:56 pm
by arras
Yes another mesh is good solution. If your water is flat, no waves, just some animated texture, it can be just one plane = 2 triangles.

Posted: Tue Jul 17, 2007 5:46 pm
by varholl
My water has wave effect.. just like in the example from irrlicht...

now i have only one huge mesh... but.. let me show you how my terrain is..

Image

if you see the image.. it hast a long coast.. and then a curved river all the way to the mountains..

i have created a mesh with the same size of the terrain... it would be ok in my scenario??

Thanks!

Posted: Tue Jul 17, 2007 8:33 pm
by arras
Do you mean vater mesh of the same size as terrain? ...As I see your terrain is 256x256 pixels large. That would mean vater mesh of 255x255=65025 tiles = 130050 polygoons. In my opinion its quit lot. That would cut my fps to standstill.

My terrain node can be updated on runtime. Try to create another terrain which would represent your water. It would move along your camera just like real terrain itself. You just need to code wave efect ...which is not so dificult, it is based on cosinus function. Look at sourcecode of Irrlicht water, there is such function.

Bug in getMaterialCount()

Posted: Wed Jul 18, 2007 2:13 am
by mhack
Hi arras, I would like to report a bug in the currently posted version (http://www.spintz.com/arras/Files/ShTlT ... 070430.zip),

the function getMaterialCount() is missing a return:

Code: Select all

// returns amount of materials used by terrain
u32 ShTlTerrainSceneNode::getMaterialCount()
{
    Material.size();
}


Posted: Wed Jul 18, 2007 3:51 pm
by arras
Right.

Corrected and updated with elvmans code.

Thansk all.

Posted: Wed Jul 18, 2007 6:41 pm
by elvman
Here is the terrain scene node using TriangleSelectors:
Download

Yesterday I found an incredible tool/terrain manager for Ogre here (check out the wiki). It is an editable terrain which is nothing impossible for Irrlicht too. I suggest starting to make something like this with ShTlTerrainSceneNode. What we need and what ShTlTerrainSceneNode does not support is: LOD, splatting and automatic lightmap generation. I could make lightmap generation using BlindSide's shader pack, but we should find some coders for splatting and LOD implementation. What do you think?

Posted: Wed Jul 18, 2007 7:00 pm
by monkeycracks
I think it'd be great to have. From what it looks like you can edit the terrain and the texture. Does that mean you can also save the heightmap and colormap? As for lightmaps and such, I'm sure there's a way to do it without shaders.. Not everyone can use them xD

Posted: Wed Jul 18, 2007 7:13 pm
by elvman
Yes, I am making a terrain editor wich is able to save the heightmap and lightmap as a BMP. Ok, I will use RTT for lightmap calculations. Wait the release of the editor. The only two things I ask is LOD and splatting. The second thing (splatting) is a little bit harder (or impossible with Irrlicht) to implement, but LOD is not so hard. I don't have time for these thing (otherwise I would do it by myself).

Posted: Wed Jul 18, 2007 7:24 pm
by varholl
This editor that you are making will be able to add objects like the irredit??

It would be really great to do that..

One suggestion... let the possibility to add water... it would be nice :D

Posted: Wed Jul 18, 2007 7:34 pm
by elvman
I will leave functions like adding scene nodes etc. for IrrEdit. I will post the first release of it in a few days. We should discuss its features and make suggestions afterwards.

Posted: Wed Jul 18, 2007 7:42 pm
by varholl
How could i use this tiled terrain with IrrEdit? Is that possible?

Thanks!!

Posted: Wed Jul 18, 2007 7:57 pm
by elvman
Simply load the heightmap and lightmap generated with my editor and use it with IrrEdit's terrain. When loading the .irr file, you should replace the Irrlicht's terrain with this one. I guess this is the only choice.

Posted: Wed Jul 18, 2007 7:59 pm
by varholl
It should be the same way if i want to use it right now right?? I can load the hegithmap and textures of my terrain on irredit.. set the correct scale and then start adding nodes..

then in my game... i replace the irr terrain for the shlterrain...

that should work too right?

Posted: Wed Jul 18, 2007 8:16 pm
by arras
LOD is something i am planing to make. In fact I already did it with some older versions of my terrain. Problem with LOD is texture. As you know texture is applied per tile ...but howe to apply texture if you have tiles which are not the same size?

You can use largest LOD tile but this would result in les detailed terrain.

Splatting? ...Can you explain? ...English is not my mother tongue and I cant find this word in dictionary.

I was also planing to make "sea scene node". It would work in similar way as terrain node. With controlable size and direction of waves and animated texture.

Now my last plans are:
To rework terrain scene node. I want to change way textures are handled. I want to implement kind of automatic texture blending, on tiles where diferent textures meet. I already have some idea howe to do it. Problem is there are some bugs in Irrlicht with OpenGL and some materials I want to use for that. I dont know if these are going to be corected. I was already reporting them.

This new terrain should have some kind of LOD.

Now problem is I dont have time for coding right now and I will probably not have it soon.