Time to create OctTree SceneNode

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.
Thomaskkc
Posts: 134
Joined: Fri Sep 15, 2006 4:04 pm

Time to create OctTree SceneNode

Post 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
kohaar
Posts: 61
Joined: Tue Oct 17, 2006 12:15 am
Contact:

Post by kohaar »

What is the polycount of your model?
Lideln
Posts: 79
Joined: Sat Jun 24, 2006 11:35 am
Location: Paris, France

Post 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)
--
Lideln, France
kohaar
Posts: 61
Joined: Tue Oct 17, 2006 12:15 am
Contact:

Post 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.
sgt_pinky
Posts: 149
Joined: Sat Oct 14, 2006 11:20 am
Location: Melbourne, Australia

Post 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...
Intellectuals solve problems - geniuses prevent them. -- Einstein
#irrlicht on irc.freenode.net
kohaar
Posts: 61
Joined: Tue Oct 17, 2006 12:15 am
Contact:

Post 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?
Thomaskkc
Posts: 134
Joined: Fri Sep 15, 2006 4:04 pm

Post 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~
sgt_pinky
Posts: 149
Joined: Sat Oct 14, 2006 11:20 am
Location: Melbourne, Australia

Post 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.
Intellectuals solve problems - geniuses prevent them. -- Einstein
#irrlicht on irc.freenode.net
Thomaskkc
Posts: 134
Joined: Fri Sep 15, 2006 4:04 pm

Post 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
sgt_pinky
Posts: 149
Joined: Sat Oct 14, 2006 11:20 am
Location: Melbourne, Australia

Post 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!
Intellectuals solve problems - geniuses prevent them. -- Einstein
#irrlicht on irc.freenode.net
Thomaskkc
Posts: 134
Joined: Fri Sep 15, 2006 4:04 pm

Post by Thomaskkc »

that means to group all the objects into group in 3dsmax?

and then load into Irr?
kohaar
Posts: 61
Joined: Tue Oct 17, 2006 12:15 am
Contact:

Post 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).
dloomis
Posts: 8
Joined: Mon Aug 14, 2006 5:00 pm
Location: TN

Post 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
Thomaskkc
Posts: 134
Joined: Fri Sep 15, 2006 4:04 pm

Post 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?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post 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.
Post Reply