how many nodes it´s healthy to use

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.
Post Reply
d3lay
Posts: 8
Joined: Thu Jan 15, 2009 10:20 pm

how many nodes it´s healthy to use

Post by d3lay »

hi there.

i´m making some snags with irrlicht and i have one question.
When i create a node, the best practice is to use the only node and get all the stuff or for every scene (game scene) i create another one ?

Example:
Node for scenarios stuff
Node for water nodes
node for bla bla bla...

thanx a lot dudes
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Could you be a little vaguer? It's almost possible to guess at what you're asking. :P
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Yeah that's pretty confusing.. :lol:

I've really no idea what you're asking but I'm gonna have a stab in the dark and make some comments that might help you.

There's not much overhead from having a large number of nodes I don't believe. Obviously having lots increases memory usage a certain amount and walking through the scene to render them could be slightly more work but probably not...

That's all CPU based stuff... The real issue could be down to GPU stuffs...

If you have 1000 cube scene nodes and are rendering them then that takes 1000 draw calls to be sent to the GPU and inbetween each one there can be a stall which will slow things down, so you could have 1000 stalls, not good!

If you have those 1000 cube scene nodes all crammed into one draw call then there's only the chance for one stall to occur instead of 1000 and you'll get a huge performance boost.

So if you're rendering a lot of the same things then things could possibly be sped up if you drew them all at once, if possible.
Image Image Image
d3lay
Posts: 8
Joined: Thu Jan 15, 2009 10:20 pm

Post by d3lay »

sorry dudes!
Pretty confusing my question.

It´s more confortable to ask if with one single node i can load all the meshes and make all colisions, waterscenes, skydomes, and everything ?

It´s kind of difficult all the theory envolving nodes, someone can explain me ?

I will be really gratefull !

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

Post by JP »

You probably don't want all those objects to be in one node... Sometimes it's good to have multiple things in a node whilst other times it's not. Generally speaking if things are seperate like water and terrain then they should be seperate nodes. If they're all linked together like walls of a building then that should be in one node pretty much.

Basically if two nodes use the same material then you can probably get a bit of a benefit from putting them in the same node as then they can be drawn together in one draw call (one draw call uses one material, no more!)
Image Image Image
d3lay
Posts: 8
Joined: Thu Jan 15, 2009 10:20 pm

Post by d3lay »

Thanx, thats solve my doubts :D
Pyritie
Posts: 120
Joined: Fri Jan 16, 2009 12:59 pm
Contact:

Post by Pyritie »

If you want a whole bunch of nodes to have a single TriangleSelector to use for collision or something, you might want to check out the IMetaTriangleSelector.
Hive Workshop | deviantART

I've moved to Ogre.
Post Reply