Better to have many scene nodes, or one giant map mesh?
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
Better to have many scene nodes, or one giant map mesh?
Is it better to make on giant map mesh with all the static objects in it? Or make the map mesh with the bare minimum amount of static objects, and use scene nodes?
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Combine as many static meshes as you can, maybe using something like Lonesome Ducky's Mesh Combiner. There's a fixed cost involved for each draw call (e.g. drawMesh, drawIndexedTriangleList, etc.) Because of this, the GPU renders faster if it has fewer draw calls per frame.
is there any possibility in the future irrlicht would be able to automatically combine meshes that are flagged as static mesh?
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
actually that is not the truth, making one whole mesh will not make a giant level run faster, the less draw calls and bounding boxes you have the least objects you can discard from drawing. You send too many vertices and models needlessly to run through the vertex shader.
It is good to combine your meshes, but only if you combine them and then split them into cells, or so called OcTrees. For example you can split meshes by using one vertex buffer but many index buffers
one vertex list and separate index buffers
It is good to combine your meshes, but only if you combine them and then split them into cells, or so called OcTrees. For example you can split meshes by using one vertex buffer but many index buffers
one vertex list and separate index buffers
I never suggested one whole mesh. I just suggested combining smaller static meshes into large ones, as this increases performance.devsh wrote:actually that is not the truth, making one whole mesh will not make a giant level run faster, the less draw calls and bounding boxes you have the least objects you can discard from drawing. You send too many vertices and models needlessly to run through the vertex shader.
It is good to combine your meshes, but only if you combine them and then split them into cells, or so called OcTrees. For example you can split meshes by using one vertex buffer but many index buffers
one vertex list and separate index buffers
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
What about the q3 map example? it uses a large static mesh. But it renders it as an octree.
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
The most optimal solution would be using both. You can combine the meshes, and then turn it into an octree! This way, you can cull unneeded triangles AND send it in one draw call. I hate to toot my own horn, but you can create an octree mesh node from a mesh created by my mesh combiner and it will do exactly that.
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
Cool, I can just export from 3D World Studio to EditIrr, and then write a quick export feature and export to giles.
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
And does it represent much cost to draw several times a single, simple, meshbuffer given you aren't drawing anything else, before you switch to another meshbuffer? each render uses the same textures, the same shaders, same index and vertex buffers and the only thing that changes is its position, rotation and scale.
The scenario i am trying to draft is that in which you try to render a crowd of characters which they share the same mesh, but their positions and rotations must be diferent, animations aside.
The scenario i am trying to draft is that in which you try to render a crowd of characters which they share the same mesh, but their positions and rotations must be diferent, animations aside.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
It will be faster than constantly having to switch textures, but not as fast as sending it in one chunk. You may be looking for instancing, where a huge group of vertices is sent to the gpu, and then they are transformed according to their separate transformations. This way, you can render around 60 objects at a time, all with different transformations. I remember someone having written an instancing shader around here, but I no longer have the linkMel wrote:And does it represent much cost to draw several times a single, simple, meshbuffer given you aren't drawing anything else, before you switch to another meshbuffer? each render uses the same textures, the same shaders, same index and vertex buffers and the only thing that changes is its position, rotation and scale.
The scenario i am trying to draft is that in which you try to render a crowd of characters which they share the same mesh, but their positions and rotations must be diferent, animations aside.
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=39680Lonesome Ducky wrote:I remember someone having written an instancing shader around here, but I no longer have the link
Haha so did I, but I actually used the proper instancing
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=38748
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=38748