Terrain Size

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
m4lomb
Posts: 8
Joined: Tue Feb 12, 2008 3:52 pm

Terrain Size

Post by m4lomb »

Hello,

I was playing with the terrain example and changed the height map to be a flat 1024x1024. It took quite a while to load, it did not render properly (it looked rectangular, not square, for the most part) and it brought the engine to its knees - down to about 9 FPS. 512X512 was no picknick either - 16 FPS and slooow. - Any suggestions?

Thank you.
sobieh
Posts: 54
Joined: Sat Feb 09, 2008 11:12 pm

Post by sobieh »

Well when you put 1024x1024 height map on a terrain it means that Engine must create 1024x1024 = 1048576 vertex mesh (more than Milioin!)

Its a little much for terrains ... but 9 fps for 1024x1024 ? ... its preety nice :)

256x256 height maps are looking preety well ... check the smoothing parameter if it looks rough for you.

Textured 256x256 height map + detail map gets 160-170 FPS for me.

If you really need/want to use so huge height map then try to play with LOD and Path size ... it can increase FPS a little but not so much. Set camera FarPlane also ... you don't need to render whole terrain all the time.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You should only use terrain patches of size 129x129. Otherwise you will encounter render artifacts (over 256 pixel wide) or texture/collision problems (for 130-256 pixels).
You have to use a tiled terrain or enhance the meshbuffer usage in the terrain node instead.
m4lomb
Posts: 8
Joined: Tue Feb 12, 2008 3:52 pm

Gee!

Post by m4lomb »

Ok, now I sound like a 3D noob, well because I am... but, I need to have a large terrain, looks like I need to build support for this eh? Somehow I must be able to do it. I have seen games with huge terrains.
m4lomb
Posts: 8
Joined: Tue Feb 12, 2008 3:52 pm

Post by m4lomb »

Before I forget, thank you for your replies, sobieh and hybrid. They definitely help gain some perspective.
sobieh
Posts: 54
Joined: Sat Feb 09, 2008 11:12 pm

Post by sobieh »

Hmm if you need just very huge terrain then you can set the Scale to 100.0f and use 256x256 height map with smoothing ... it will be preety big then but it loose some detail. If you're trying to make Smooth looking terrain like a grass and hills without any complex heights then this way seems to be best for you.

Other way for very detail and complex big terrains is to make a Custom node with couple child terrain nodes as sectors. You can still use 256x256 height map but you can use separate maps for each terrain sector which make it very very detail. Detail level here depends only on sector scale and how many sectors you use. To "not kill" your GPU check the camera position and set visible sectors to "visible" and hide the non visible.
This method is not quite good solution but works well with 50-60 FPS.

ps. All i posted here is for stock Irrlicht engine ... as Hybrid said using Arras tiled terrain node is a lot better and faster solution. It's easier to use also.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You can also use the terrain mesh (as opposed to the terrain scene node). It's available in the geometry creator. You will lose all the mentioned features of the terrain scene node, but you can stil use height maps. And with hw buffer support in Irrlicht 1.5 you should be able to use huge meshes without terrible performance impact. Or use terrain meshes from any 3d modelling tool, maybe in conjunction with octree optimization.
morris
Posts: 36
Joined: Tue Jul 10, 2007 10:10 am

Post by morris »

you can also use arras' tiled terrain scene node if you only render parts of the terrain (for example at the players position). use the search function for "new tiled terrain" or sth like that.
Post Reply