Mesh sorting does not work for instanced meshes, because they are treated differently from other meshes (you can see that your PG is working if you replace createInstance
with clone
).
You can set the Mesh.INSTANCEDMESH_SORT_TRANSPARENT
flag to true if you want to sort transparent instanced meshes, but you don’t have a choice of metric; they will be sorted by distance from the camera.