I’ve got what I think is a perfect candiate for using DrawMeshInstanced - loads of identical transparent background tree billboards. However when I ‘convert’ the billboard gameobjects to a 4x4 array and use DrawMeshInstanced instead, the depth sorting of the meshes is all screwed up.
My best guess is that every frame I need to do some sort of sorting on the array in order to draw them in the correct order (based on distance from camera I guess), but that seems like a lot of work? Am I overlooking something, or not using it right, or missing a shader setting, or… something else?
No, you got it right. You need to sort them yourself. By using DrawMeshInstanced you’re effectively telling Unity “hey, I got this” and taking over responsibility for sorting. If you want Unity to handle the sorting just leave the billboarded objects as game objects in the scene with instanced shaders/materials and it’ll handle it for you.