I need the UNITY_MATRIX_VP matrix, that’s defined in shaders, as a Matrix4x4 in a script. How can I find it?
I tried to calculate it using camera.projectionMatrix * camera.worldToCameraMatrix, but that is not it.
I need the UNITY_MATRIX_VP matrix, that’s defined in shaders, as a Matrix4x4 in a script. How can I find it?
I tried to calculate it using camera.projectionMatrix * camera.worldToCameraMatrix, but that is not it.
I use
GL.GetGPUProjectionMatrix(camera.projectionMatrix, true) * camera.worldToCameraMatrix
Perfect, works like a charm. Thank you ![]()