Speed problems with lots of primitives
Posted: Fri Jun 22, 2007 4:27 pm
Hello, I need to use a 50x50 grid os small spheres in my program, but it makes Irrlicht go extremelly slow... here it is the code I use:
You can put it in the the Terrain example to see how slow it goes...
Does anyone have an idea of why is so slow? What am I doing wrong to get this slow speed? What can I do to improve it?
I cannot join all the geometry in one only object, as later I need to select each sphere individually...
Thanks in advance!
Hugo
Code: Select all
for (int y = 0; y < 50; y++)
{
for (int x = 0; x < 50; x++)
{
scene::ISceneNode* DotSceneNode = smgr->addSphereSceneNode(.5, 8, NULL, IDFILTER,
core::vector3df(6*x,6*y,0));
DotSceneNode->getMaterial(0).AmbientColor.set(128, 0, 0, 255);
}
}
Does anyone have an idea of why is so slow? What am I doing wrong to get this slow speed? What can I do to improve it?
I cannot join all the geometry in one only object, as later I need to select each sphere individually...
Thanks in advance!
Hugo