I have a procedural shader dispatched with a DrawProcedural() call inside OnRenderObject() for one of my components.
While UNITY_MATRIX_MVP contains the correct camera and projection transforms, the transform for the object the component is attached to are not present.
When does Unity set the model/world transforms?
(Or, in what callback should I call DrawProcedural() to ensure they are in UNITY_MATRIX_MVP?)
Thanks ericbegue, I will give that link a thorough look. By “not present” I mean the transform supplied to the shader remains the same, regardless of the parameters of the Transform of the gameobject to which the component script is attached.
Ok I solved this by using a CommandBuffer, the DrawProcedural function in the CommandBuffer class takes a matrix. I then just used Graphics.ExecuteCommandBuffer