Performance issue

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.
Gaurav Gangwar
Posts: 23
Joined: Thu Jul 31, 2008 7:35 am

Performance issue

Post by Gaurav Gangwar »

Hi guys,

I have got a my.bsp file which has got 184978 polygons
these polygons are not uniformly distributed the largest number of polygons are inside a building.

here is the system cofiguration 2 Gb RAM , Pentium4 CPU 2.66GHz ,

The Problem is that when i move the mouse right or left the response time to mouse movement is very slow and the scene takes lot of time to render

Is it because of PolygonCount?

If yes then how problem can we solved.

Thanks

For reference following is the code

device->getFileSystem()->addZipFileArchive("My.pk3");
m_Selector = 0;
SceneHierarchy::IAnimatedMesh* mesh = SceneManager->getMesh("My.bsp");
SceneHierarchy::ISceneNode* node = 0;
if (mesh)
node = SceneManager->addOctTreeSceneNode(mesh->getMesh(0), 0, -1, 128);

SceneHierarchy::ITriangleSelector* selector = 0;
if (node)
{
node->setPosition(Core::vector3df(-350,-130,0));
selector = SceneManager->createOctTreeTriangleSelector(mesh->getMesh(0), node, 128);
node->setTriangleSelector(selector);
}
int Polycountt = SceneManager->getMeshManipulator()->getPolyCount(mesh);
//*** set FPS camera and Node Animator for collison detection
camera = SceneManager->addCameraSceneNodeFPS(0, 100.0f, 200.0f, -1, 0, 0, true);
Last edited by Gaurav Gangwar on Mon Nov 10, 2008 2:47 pm, edited 1 time in total.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Are you merely rendering the BSP mesh? And doing nothing else special?

I guess you could try splitting the BSP mesh into smaller meshes... like having things inside the room as seperate meshes or something... though i would have thought the oct tree node would have helped enough there...
Image Image Image
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

First, do a release (not debug) build of Irrlicht and your app. Don't (literally) waste your time profiling a debug version.

If you're actually using the oct tree triangle selector, that's also going to contribute.

I would heartily recommend splitting this mesh up. Even as an oct tree, there are going to be degenerate cases where you'll render or test collision against a lot of polygons. Oct trees aren't a magic solution for understanding your own geometry and optimising the use of it at an application level.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Gaurav Gangwar
Posts: 23
Joined: Thu Jul 31, 2008 7:35 am

Post by Gaurav Gangwar »

Thanks for the reply,

JP i have got a huge world in the file (a lot of buildings, models etc...)
In one building i have got objects that have lot of polygons for very good view so that they can be easily recognized and the player has to click on them according to the voice command

apart from this few humans(in b3d format) are moving there
Gaurav Gangwar
Posts: 23
Joined: Thu Jul 31, 2008 7:35 am

Post by Gaurav Gangwar »

Do i have to split it into different level is there any tools available for that?

thanks a lot for the rply
jontan6
Posts: 278
Joined: Fri Jun 13, 2008 5:29 pm

Post by jontan6 »

check your textures. make sure the resolution are reasonable. usually my largest textures are 1024X1024 but very very few only. most are 512X512 and under.

i experience when i have huge texture, say 4000X4000, it is slow when you turn to the side where the texture is used

btw, what is ur vidcard?
Gaurav Gangwar
Posts: 23
Joined: Thu Jul 31, 2008 7:35 am

Post by Gaurav Gangwar »

Yes a lot of them are more then 512X512
Gaurav Gangwar
Posts: 23
Joined: Thu Jul 31, 2008 7:35 am

Post by Gaurav Gangwar »

I dont have graphics card and videocard is onboard
Eigen
Competition winner
Posts: 375
Joined: Fri Jan 27, 2006 2:01 pm
Location: Estonia
Contact:

Post by Eigen »

That should have been stated in the first post! In that case it's probably unavoidable, depending on what on-board graphics card you have.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Yeah onboard graphics cards can be terrible... But also the type of driver you're using (directx, opengl, software?) can have an effect and also whether your drivers are up to date or not. When changing from Irr 1.4 to Irr 1.4.1 (i think) my opengl performance plummeted until i updated the drivers on my graphics card.
Image Image Image
Gaurav Gangwar
Posts: 23
Joined: Thu Jul 31, 2008 7:35 am

Post by Gaurav Gangwar »

Hi Guys,

Thanks for responding....

We are not sure if it is something to do with the graphics or the engine code. The reason i say this is because, i have tried running the same bsp on a Quake engine and it works great without the graphics card.

Currently when we run the "graphically heavy" bsp using the IrrLicht engine, and check the memory in the task manager, it is consuming about 1.6GB of memory (which is way too high). While on the Quake engine the same runs well under 200MB.

My questions are -
1. is it because we are using bsp files instead of .irr file. Should we convert the bsp files to .irr file? if yes, then what is the easiest way to do that?
2. When we use a decent video card, then everything runs fine. Is getting a video card the only solution? If yes, then it still fails to tell me why it is running so nicely on the quake engine.
3. Last question, as mentioned in the responses, I need to split the mesh. How do we do that? Is there an easy way to take care of it?

Appreciate all the help you guys can provide.

Thanks,
Gaurav.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

I think splitting the mesh would best be done in a modelling program.

Quake utilises the BSP format correctly, Irrlicht does not. The implementation is not complete which could be part of the reason for the extra memory usage... hard to say though, shouldn't be that much higher i don't think...

Using an .irr file wouldn't help as .irr is just a scene format so would just contain a string of the BSP path and then irrlicht would load the BSP the same as you're loading it now.

I don't know much about the BSP format and what you can have in it but if you've got multiple instances of the same mesh within it then it may be that Irrlicht is creating them each time whereas Quake may just create the object once and then reuse it in some way when a new instance is required...
Image Image Image
jontan6
Posts: 278
Joined: Fri Jun 13, 2008 5:29 pm

Post by jontan6 »

Gaurav Gangwar wrote:Yes a lot of them are more then 512X512
can you try resizing all your big textures to smaller one and see the results?
jontan6
Posts: 278
Joined: Fri Jun 13, 2008 5:29 pm

Post by jontan6 »

btw, as you said, the issue is high memory. maybe because of collision detection or other code aside from rendering?
Gaurav Gangwar
Posts: 23
Joined: Thu Jul 31, 2008 7:35 am

Post by Gaurav Gangwar »

Yes High memory is my problem and the other one is that it takes time to move the camera ie when the mouse is moved right or left and the building with lot of polygons comes in the view of camera then FPS become very low eg 2 FPS

jontan
if i only load the bsp file and dont put the collision detection the problem remains there

JP- I am using DirectX9 on XP SP2
Post Reply