adding terrain node slows down application

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
markus
Posts: 23
Joined: Tue Mar 01, 2005 9:01 pm
Location: Germany

adding terrain node slows down application

Post by markus »

Hi,
i just added some terrain to my application, like it is described in the new terrain tutorial.

Unfortunately i noticed a massive slowdown when moving the fps cam with the arrow keys.
Framerate drops from around 400 fps down to 240fps. (debug exe)
My system is an AMD 64 3200+, 1GB RAM, Nvidia GF6600GT PCIe.
So this shouldn't be too weak.

Is this normal?
How can the movement of the cam be made faster?

Is there a means to adjust the view range of the terrain?

Greetings
Markus
cartoonit
Posts: 286
Joined: Mon Nov 15, 2004 6:36 pm

Post by cartoonit »

What size is the terrain?? I've never used this part of the engine yet, but if its quite large then I'd expect a big drop in the FPS, you could try culling the scene node, or even use the PVS tool that Electron has developed. I'm not sure whether this would work with the terrain, as I said before I've not used it yet...
dopyiii
Posts: 26
Joined: Wed Mar 23, 2005 7:48 pm

Post by dopyiii »

I noticed that when I added a terrain, my FPS dropped too (by about 50%). But it makes sense since you're rendering a lot of polygons to do terrain. I noticed the biggest decrease when adding stuff to my terrain - just the terrain itself wasn't too bad. There's a couple of things to try that might help out your FPS.

First, what size texture are you using? If you use a really big texture, it could make things a little slower (but I wouldn't think so on your system).

Next, try playing with your texture scaling. If you're not scaling, but rather using one big texture like in the tutorial, then this won't matter.

I personally use one smaller texture and just set the scaling to about 10, but that's just personal preference.

Another idea is to make sure that you don't turn off the LOD settings. I didn't like how my texture was blurred so close so I turned it off and it made things look worse and my FPS dropped even more. I had to do some digging to find this, so if you haven't turned it off on purpose, it's probably still on.

I know you can adjust the movement to be faster, but you might want to consider some time-based movement instead. Check out this post for some ideas: http://irrlicht.olinuxu.cz/phpBB2/viewt ... -t=723.htm.

In response to your other question about viewing distance, you can change this by setting the farValue in your camera (camera->setfarValue(x)). Try something like 6000-9000 (or adjust whatever you have). Setting up linear fog in this range might help mask the appearance of your terrain disappearing.

There might be some other enhancements that I just don't know about (I'm still fairly new to irrlicht), but maybe something here will help. It'd be nice if someone that was very skilled with the new terrain stuff were to post an "advanced" tutorial on implementing terrain (optimizations/enhancements, texture blending, lightmaps, etc.).
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

terrain like any lets call it high poly object will impact performence.

try the textures try the size but there is a way to limit the view clipping also.

Code: Select all


// add fps camera
camera = smgr->addCameraSceneNodeFPS(0,100.0f,300.0f);
camera->setPosition(core::vector3df(-100,200,-600));

// add normal camera
//camera = smgr->addCameraSceneNode(0, core::vector3df(5,0,5), 
//core::vector3df(100,0,100));
make a camera then use

Code: Select all


camera->setFarValue(100);

that will clip the farplane
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

Is there a means to adjust the view range of the terrain?
There's a couple things you can do. The farPlane of the camera has been mentioned, but you can also tweak the ranges that determine which LOD is rendered.

Hmmmm, just noticed a bug in the TerrainSceneNode, sorry, where the LOD distances calculated will become incorrect, if you scale the node more than once. The terrain scene node needs to keep track of total scaling based off of the original 1.0 scale. So, if you're having problems and are applying scale more than once to the node, this might be your problem.

I'll post a bug fix to Niko for this.
Image
Post Reply