One Mesh = One Node or decompose the mesh in many nodes.

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
Danny Gilbert
Posts: 54
Joined: Thu Oct 25, 2007 1:38 pm
Location: Montreal, Canada

One Mesh = One Node or decompose the mesh in many nodes.

Post by Danny Gilbert »

Hi !

Is it faster to create a MESH composed of 2 walls, 1 top and 1 floor (like a tube or corridor: 6 vertex, 8 triangles, 4 textures ) and add it in the SCENE as a unique ICustomSceneNode OR IS IT FASTER to create 4 individual ICustomSceneNode, one node for each wall, top and floor (one node = QUAD) ?

My point is that everywhere in the forum, I see that more we have nodes, slower is the game. But for me, a MESH is a node which is more complex than the QUAD (wall, floor or top) represented by a node. At the end, we have the same number of vertex (vertices) ??

There is something that I don't understand.
Can someone can explain ?

Thank you !
Praetor
Posts: 42
Joined: Wed Jun 20, 2007 2:31 am

Post by Praetor »

Having more nodes slows it down even if the vert/tri counts are the same, since with multiple node all of the pre-render setup, material setup, etc. must be run for a node, then it renders the mesh, then setup the next node, then render it and so on each frame, as opposed to setting it up once for a single node then rendering everything all at once per frame (so despite rendering the same number of tris, the setup of each node before rendering it slows things down). This is why having, for example, 1000 12 poly objects is a lot slower than 10 1200 poly objects.

I hope I explained that clearly enough... if you have any other questions feel free to ask.
"Surely we don’t need to waste resources on pathfinding; they just need to walk along the shortest route from one place to another." - EA Producer
Danny Gilbert
Posts: 54
Joined: Thu Oct 25, 2007 1:38 pm
Location: Montreal, Canada

OK cool !

Post by Danny Gilbert »

Thank you very much !
This is what I want to ear.
:D
Saturn
Posts: 418
Joined: Mon Sep 25, 2006 5:58 pm

Post by Saturn »

But this is a question of balance too. If you have a single big mesh for your level with 300k vertices, then this is a bad idea too. As, even when your camera only sees a 10th of it, all the vertices are sent to the GPU regardless, each frame anew.

So breaking the big ones into parts is god, but in the range of vertices you name, batching them into a single node is clearly better.
Post Reply