[SOLVED]: DrawMeshInstancedIndirect subMesh Issues

Hey guys/gals,

I posted this over on the URP section but the more I think about it the more I think it probably belongs in the general section since it may not relate to the URP.

I have been racking my brain on this issue. I’ve been toying around with the DrawMeshInstancedIndirect which has been working great so far. I have custom shaders that work as expected with models that have multiple subMeshes. My issue comes when I try to add multiple objects with the same material on them. For some reason the models display with missing faces. I tried the standard cube and it was missing a face just like the others.

I tried using a super simplified shader thinking that it was my shader code but came out with the same results. I posted a couple of images to show what the issue is.

CORRECT:

INCORRECT: (Missing Geometry)

Any suggestions or help would be fantastic!

Thanks,
Jake

Solved the issue with this code with help from Mike at taqoz.fyi. I was putting buffer info into a sharedMaterial which overwrote the previous submesh containing that same material.

View the solved code here: