Page 1 of 2

Time to create OctTree SceneNode

Posted: Wed Nov 01, 2006 7:40 am
by Thomaskkc
I have create the OctTree SceneNode and need to wait at least 1x to 2x sec, it wait such a long time

so I'd like to ask that is there any method to shorten the time to create the OctTree and still can preform the same operation?

Thanks

Posted: Wed Nov 01, 2006 5:54 pm
by kohaar
What is the polycount of your model?

Posted: Wed Nov 01, 2006 5:58 pm
by Lideln
I had an octree creation time of around 1 second with a polycount of 4000 (or something).

Your model seems to be quite a high poly ?

AFAIAC, I switched for a low poly model, of course less beautiful, but now the octree creation time is only a few milliseconds... (less than 10)

Can't you make the polycount smaller ?

Also, I don't think that 1 second is awful ? (unless you have 100 different high poly models)

Posted: Wed Nov 01, 2006 8:24 pm
by kohaar
My laptop takes about 40ms with a 10k poly model. Maybe the file format is a factor? Don't know enough about the engine to answer that.

Posted: Wed Nov 01, 2006 10:44 pm
by sgt_pinky
I'd like to ask that is there any method to shorten the time to create the OctTree and still can preform the same operation?
You could just buy a new computer...

Posted: Wed Nov 01, 2006 11:12 pm
by kohaar
sgt_pinky wrote:You could just buy a new computer...
… Or you could upload your model, and I could try to run a comparison on my computer?

Posted: Thu Nov 02, 2006 5:33 am
by Thomaskkc
Needed 2435ms to create OctTree SceneNode.(1265 nodes, 45960 polys)
Needed 16236ms to create OctTreeTriangleSelector.(697 nodes, 45960 polys)

is that really too large?
is that any method that to reduce the time to create such large number of polys?

coz my project is need to draw lots of diagrams and polys, so is that possible that i can reduce the creation time?

thanks a lot~

Posted: Thu Nov 02, 2006 5:44 am
by sgt_pinky
Yes, it's large. A current game with good hardware aims to have <60k polys on the screen.

I still don't see why this is a problem. You only have to do it once, presumably. Have a look at the loading time of a game like Battlefield 2142 for example - close to 1 minute even on a good machine.

Posted: Thu Nov 02, 2006 5:48 am
by Thomaskkc
that mean that if i continue to add more texture and objects
it will load to slow

is that the disadvantage of this?
is that any solution to encount this problem?
coz if i demo, it may need to wait to long and it may be not so effective

Posted: Thu Nov 02, 2006 6:23 am
by sgt_pinky
The solution is to optimise your scene. For example, combine polys in your modeling program (eg, Blender or 3DS Max, or whatever).

If you cant pre-process your scene like that, you might be able to do some triangle-consolidation inline using a code like:

http://www.plunk.org/~grantham/public/actc/

Unfortunately technology isn't at the level where we can throw 10 million polys at it yet!

Posted: Thu Nov 02, 2006 6:58 am
by Thomaskkc
that means to group all the objects into group in 3dsmax?

and then load into Irr?

Posted: Thu Nov 02, 2006 9:11 am
by kohaar
No. Grouping objects will not remove polys. An example

Image

This two objects are practially the same where one has less polys than the other.

You can use the optimize modifier, but you may have to uw map your model again. You can also use the edit poly modifier but in a very complex model that would require a lot of work (remember to check preserve uw coordinates).

Posted: Thu Nov 02, 2006 7:27 pm
by dloomis
You could load them in irrEdit... let it create the OCTree for you... then use the resulting DAE file so the octree must only be created once... you will probably need to patch Irrlicht to the updated Collada loader.

David

Posted: Fri Nov 03, 2006 7:41 am
by Thomaskkc
dloomis wrote:You could load them in irrEdit... let it create the OCTree for you... then use the resulting DAE file so the octree must only be created once... you will probably need to patch Irrlicht to the updated Collada loader.

David
how to use the resulting DAE file?
would you explain more or give some examples?

Posted: Fri Nov 03, 2006 2:46 pm
by CuteAlien
Seems the most time get's lost when you create the triangleselector.
I had the same problem, so i made a triangleselector which does use the octree which is already available for OctreeSceneNodes. The code can be found on http://www.michaelzeilfelder.de/irrlicht.htm
I've currently no time to make a clean patch, so unfortunatly you will have to find out yourself if those files do work with a current version of irrlicht. But i think it won't be much of a problem to fix em if they cause any problems.