After the physics step, rendering takes place without copying the position and rotation data onto the CPU by using Unity's Command Buffer version of DrawMeshInstancedIndirect. At the time of writing this API is brand new and seems to have some bugs. For example, I cannot seem to render anything using this method on a Mac. Nothing renders when the Camera's clear mode is set to Solid Color (the image above is Skybox). Some of these bugs can be resolved by excluding rendering from the command buffer and rendering using Graphics version of DrawMeshInstancedIndirect instead. Despite these bugs, I am very thankful to Unity for providing these APIs and empowering my creative development.



I'm hoping that by open sourcing this code, it can be used as an example of cutting edge, efficient GPU use in Unity.

There are likely errors in the application of the damping and tangential forces in the collision resolution step of the compute shader, and in the integration of angular momentum, and also perhaps in the worldToObject matrix calculation in the Surface Shader. I have a limited understanding of all of these areas, and cannot confirm their correctness. If you find errors in those places, please let me know.