Performance issue
-
- Posts: 23
- Joined: Thu Jul 31, 2008 7:35 am
Performance issue
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);
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.
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
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.
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
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
- Posts: 23
- Joined: Thu Jul 31, 2008 7:35 am
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
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
-
- Posts: 23
- Joined: Thu Jul 31, 2008 7:35 am
-
- Posts: 23
- Joined: Thu Jul 31, 2008 7:35 am
-
- Posts: 23
- Joined: Thu Jul 31, 2008 7:35 am
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.
-
- Posts: 23
- Joined: Thu Jul 31, 2008 7:35 am
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.
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.
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...
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...
-
- Posts: 23
- Joined: Thu Jul 31, 2008 7:35 am
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
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