http://irrlicht.sourceforge.net/forum// ... hp?t=39154
this link introdued a way to batch those meshes whose materials are the same, from what I know that there're similar concept in DX10 named 'instancing', are they the same thing?
what's difference btw batchingmesh and DX10 instancing
-
huntersh2014
- Posts: 12
- Joined: Mon Mar 26, 2012 6:37 am
Re: what's difference btw batchingmesh and DX10 instancing
no they are not the samething batching is mostly used to group meshes that don't move into a single one in order to reduce the overhead each draw call cause now this technique is mostly used only for static object because they cannot easyly be moved around.
Instancing aim to reduce the amount of draw call to but it can be used with dynamic objects that moves around because each object can have it's own transform matrix and it comes with the adventage that it use les memory they batching as you don't need to store the mesh many times
now also there are hybrid methode like shader batching that can bring back some feature of instancing with some other drawback
also instancing is availible on DX9 and OGL hopefully soon through irrlicht to
Instancing aim to reduce the amount of draw call to but it can be used with dynamic objects that moves around because each object can have it's own transform matrix and it comes with the adventage that it use les memory they batching as you don't need to store the mesh many times
now also there are hybrid methode like shader batching that can bring back some feature of instancing with some other drawback
also instancing is availible on DX9 and OGL hopefully soon through irrlicht to
Re: what's difference btw batchingmesh and DX10 instancing
A batch is a set of meshes that are grouped into a single big mesh so they can be drawn at once, the diference with instancing is that while you draw the meshes with a single call, the drawn meshes have to be copies of an original mesh and are all the same.
In this case, pseudo instancing is more flexible because the stored meshes can be diferent, while the transformations apply the same.
In this case, pseudo instancing is more flexible because the stored meshes can be diferent, while the transformations apply the same.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
-
hybrid
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: what's difference btw batchingmesh and DX10 instancing
Batching copyies a lot of polygons into one huge mesh, but the vertices are still all copied from CPU to GPU (sometimes only once, but still all vertices at least once). Instancing copies just the base description of one part, while all other meshes are just copies of this one mesh. Therefore, you pass at least one transformation matrix per instance (also at least once, for static instancing that's enough). So it also only helps if you have non-trivial meshes, but of course has a lot of advantages over batching as described above.
-
huntersh2014
- Posts: 12
- Joined: Mon Mar 26, 2012 6:37 am
Re: what's difference btw batchingmesh and DX10 instancing
Thank you all for the quick feedback.
does it means that if there's a cube and a sphere in the scene(the material on them are the same), they could be batched but not instanced?
another question is: could we really gain the performance benefit due to the overhead - copying vertices from meshes to a single one? Thanks!
does it means that if there's a cube and a sphere in the scene(the material on them are the same), they could be batched but not instanced?
another question is: could we really gain the performance benefit due to the overhead - copying vertices from meshes to a single one? Thanks!
-
huntersh2014
- Posts: 12
- Joined: Mon Mar 26, 2012 6:37 am
Re: what's difference btw batchingmesh and DX10 instancing
Or why do we use batching but not instancing, is there anything that batching can do but instancing cannot?
Re: what's difference btw batchingmesh and DX10 instancing
In both cases, the number of draw calls is one, the diference is:
-Instancing draws a single mesh many times with multiple transformation matrices
-Batching stores all the meshes inside a large mesh and renders it at once. It only uses 1 transformation matrix, but the batched objects cannot be diferenciated.
-Instancing draws a single mesh many times with multiple transformation matrices
-Batching stores all the meshes inside a large mesh and renders it at once. It only uses 1 transformation matrix, but the batched objects cannot be diferenciated.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt