Cant understand concept of merge-instancing

842 views Asked by At

I was reading slides from a presentation that was talking about "merge-instancing". (the presentation is from Emil Persson, the link: www.humus.name/Articles/Persson_GraphicsGemsForGames.pptx, from slide 19)

I can't understand what's going on, I know instancing only from openGL and I thought it can only draw the same mesh multiple times. Can somebody explain? Does it work differently with directX?

1

There are 1 answers

0
Nadir On

Instancing: You upload a mesh to the GPU and activate its buffers whenever you want to render it. Data is not duplicated.

Merging: You want to create a mesh from multiple smaller meshes (as the complex of building in the example), so you either:

  • Draw each complex using instancing, which means, multiple draw calls for each complex
  • You merge the instances into a single mesh, which will replicate the vertices and other data for each complex, but you will be able to render the whole complex with a single draw call

Instance-Merging: You create the complex by referencing the vertices of the instances that take part on it. Then you use the vertices to know where to fetch the data for each instance: This way you have the advantage of instancing (Each mesh is uploaded once to the GPU) and the merging benefits (you draw the whole complex with a single draw call)