Instanced Meshes

@marwie1 :cactus: I can’t see the ?debuginstancing working in my model viewer here using this test model for instancing drag/dropped into the window, what am I doing wrong?

untitled.glb

by user 103054507105067008

Instancing needs to be enabled on your materials in Unity / Blender when exporting with needle

This file is just a regular GLB where materials don’t have that kind of information, it won’t use GPU instancing

Ah, is there a workflow for exporting instanced meshes in a glb file here? As in gltf.report recognises one mesh from the file so instancing is working there

by user 103054507105067008

That’s something different

Yes, there is one mesh there, and the same in Needle

Oh good

by user 103054507105067008

All nodes will be using the same mesh

So in a sense the mesh “instance” is used for all nodes

That’s all I needed really, I might have mixed up instancing with gpu instancing

by user 103054507105067008

?debuginstancing shows you GPU Instancing in use, so basically many objects being rendered in one draw call using instanced indirect

Is there a url parameter for regular instancing?

by user 103054507105067008

Not sure what you mean! If the nodes all use one mesh then they use one mesh

We’re not duplicating data or anything

So in other words “what you put in the file is used”
If there’s 20 cubes with unique meshes each then you get 20 unique meshes
If the 20 cubes share the same mesh then, well, they share that mesh :smile:

Just wondered if there was a way to preview that but no worries if not I can use gltf.report

by user 103054507105067008

I see :slightly_smiling_face:

by user 103054507105067008

So you don’t mean “preview” but basically “show statistics about data in the file”, right?

Yes

by user 103054507105067008

You can do that with either https://gltf.report or https://viewer.needle.tools or babylon sandbox or gestaltor or VS Code or …