performance problems? is irrlicht slow?

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.
arokh

performance problems? is irrlicht slow?

Post by arokh »

hello,

i am encountering some performance issues with irrlicht. just to test the performance of the engine i used the HelloWorld example to render 100 of this sydney models, which makes an amount of ca. 140.000 polys. but i just got a frame rate of 14. my configuration:

AMD XP 3000
1GB RAM
Geforce 6600GT

i find 14 very low for that? has anyone an idea why it is like that, or is irrlicht just quite slow? i found some posts in the net, telling that irrlicht has a good performance. for comparision: rendering 400.000 - 500.000 polys with osg has about the same frame rate O.o (not exactly sure, i already deleted osg because i hated it but i was impressed by its speed).

so is it true or am i just doing something wrong, by simply adding the models in a row?
pfo
Posts: 370
Joined: Mon Aug 29, 2005 10:54 pm
Location: http://web.utk.edu/~pfox1

Post by pfo »

That does sound odd. Your machine sounds pretty fast, there must be something odd about putting a ton of sydneys back to back. I've been using Irrlicht for a few months, I find it to be fast.
needforhint
Posts: 322
Joined: Tue Aug 30, 2005 10:34 am
Location: slovakia

Post by needforhint »

if you post your code where you "multyplied" your sydneys, maybe we will all see that you are having 100 instances of a meshnode with a Imesh in it (so you have 100 sydneys in your dynamic memory....which is only 1GB...instead of having one ) ...are you atleast crating it as octtree?
what is this thing...
Guest

Post by Guest »

needforhint > could you re-explain that please. I take it you are trying to say that you should (obviously) load and store 1 mesh and use instances of that mesh (copies)?

So what is the correct way to do that?

IAnimatedMeshSceneNode = SceneManager->getMesh();

or

sm->addAnimatedMeshSceneNode.

or

something else???

thnx
arokh

Post by arokh »

thanks for the answers so far. here's the code part which should be relevant. i hope it helps:

Code: Select all

IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");


for (int j=0; j<20; j++)
    for (int k=0; k<20; k++)
    {
        IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
        node->setPosition(vector3d<f32>(-(f32)j*20, 0.0, (f32)k*20));
        node->setMaterialFlag(EMF_LIGHTING, false);
        node->setFrameLoop(0, 310);
        node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") );
    }
  
	
smgr->addCameraSceneNodeMaya();
while(device->run())
    {
        driver->beginScene(true, true, SColor(255,100,101,140));
        smgr->drawAll();
        guienv->drawAll();
        driver->endScene();
    }

As I said, I just started to use Irrlicht and tested it's performance. Thats why I don't know about how to use an octree, I was just going straight ahead. I'll take a look for this octree in the documentation.

I was looking for a graphic angine that has a good gui available and Irrlichts GUI is great, compared to what other engines have (mostly as additionaly libs). And also the API of Irrlicht is very intuitive, thats why I would like to use it, just this performance thing is a little odd :shock:

all suggestions are very welcome, thanks a lot :)
arokh

Post by arokh »

In the posted code was one mistake: there I am rendering 400 models, which is about 270.000 polys and resulting in even less frames. the 14 frames occur when i render just 200 models (j<10). well doesn't change the problem, but not that you think i just counted my models wrong :D
needforhint
Posts: 322
Joined: Tue Aug 30, 2005 10:34 am
Location: slovakia

Post by needforhint »

put the IAnimatedMeshSceneNode* node; before the cycle, and in cycle use "node = smgr->addAnimatedMeshSceneNode( mesh );" . don't forget, helloworld uses software render so change it to direct3d 9.0
what is this thing...
needforhint
Posts: 322
Joined: Tue Aug 30, 2005 10:34 am
Location: slovakia

Post by needforhint »

here is a demonstration http://www.medeal.sk/irr/ for all of you who find irrlicht "slow", there is a 32bit per pixel render turned on and a moving light is placed so every dwarf is calculated in your graphic card uniqely
Last edited by needforhint on Fri Oct 21, 2005 11:35 am, edited 1 time in total.
what is this thing...
arokh
Posts: 9
Joined: Tue Oct 18, 2005 9:23 pm
Location: Germany

Post by arokh »

i was already using direct3d 9.0 and also tried direct3d 8 and opengl, they all result in the same frame rate. well i will try to put "IAnimatedMeshSceneNode* node" out of the loop, but i am afraid this will not change anything, for the drawing is not happening there but in a later loop. but for sure my way was poor style.

well i will take a look at your example with the dwarfs :)

are there some kinda "benchmarks" of Irrlichts performance on different machines? I'd like to compare how much my machine should be capable of.

thanks so far
arokh
Posts: 9
Joined: Tue Oct 18, 2005 9:23 pm
Location: Germany

Post by arokh »

@needforhint: your demo runs on 64 FPS, seems much better. can you put the code somwhere? maybe if i compare the code i find the problem. and: thanks for your answers :)
needforhint
Posts: 322
Joined: Tue Aug 30, 2005 10:34 am
Location: slovakia

Post by needforhint »

go for it 8)
what is this thing...
Jan_
Posts: 16
Joined: Wed Sep 28, 2005 11:39 am
Location: Germany, Chemnitz, Bgst.

Post by Jan_ »

hm,

I think it is a Graphicscard and Engine Problem.
if you make 1 mesh, with 1'000'000 Polygon it runs with 60 fps
but if you make 100 x animationcount Meshs with 140'000 x animationcount polygon you have 10fps.
First, the engine have to Flusturm all, 2. the engine, have to animate all
3. the Graficscard, need to set a own texture, per loaded mesh. (100x animationcount and 1 mesh.)

I think, thats it.
Guest

Post by Guest »

is that right? if you load 100 meshes but they all use the same texture then it SHOULD only be used and set once per frame, at least that is what I thought was happening.. in the docs it states if it is already loaded it won't be loaded again - and batching will make sure it renders all with X texture before moving on. So I can't see it swapping textures 100 times at all.

I could be wrong, please someone let me know If I am and need to do more manual batching.
Jan_
Posts: 16
Joined: Wed Sep 28, 2005 11:39 am
Location: Germany, Chemnitz, Bgst.

Post by Jan_ »

No, the Texture, isn't loaded a 100 times, but, the Surfaces are.

We testet yesterday it, 6000 Quad's of Grass with 2 FPS (Each has his own surface)
And all Quads in 1 Surface, 80 FPS.

There many ways to Optimise it.
arokh
Posts: 9
Joined: Tue Oct 18, 2005 9:23 pm
Location: Germany

Post by arokh »

Well first: I solved my little speed problem, thanks for the help. Though I still don't know what happened, I just copied the code to a new project and it worked. Maybe some stupid Problem with the Project settings.

I looked a little bit deeper to the OpenGL source of Irrlicht (I don't know DirectX) and I think one issue of Irrlicht is, that it is not optimized for specific kinds of models. Which is good on the one hand, because it keeps the API easier, but bad on the other hand, because it might lack in speed sometimes. If you have static models (like houses or trees) you can optimize a lot (using display lists of OpenGL for example). But using an animated model or not, doesn't make a real difference in Irrlicht (in ways of performance) it's using mainly the same way of rendering. I tested Irrlicht against OSG (which is really fast, but sucks about the rest (API, docu, ...)) with static models and OSG is almost 3 times faster (2000 models, together more than 1.300.000 polys: still 12 FPS).

Anyway I will go on with Irrlicht, for it is still fast enough and has a great API and a GUI System included. Try to get a GUI running with other Engines ...
Post Reply