Hi, I’m writing a shader and would like to write my own billboarding, for this I need the inverse view matrix, I’m not sure if unity will let me have this information however.
Is there anyone with shader experience who can give me a hand? Thanks
Hi, I’m writing a shader and would like to write my own billboarding, for this I need the inverse view matrix, I’m not sure if unity will let me have this information however.
Is there anyone with shader experience who can give me a hand? Thanks
If you come here in 2023 like I did, there is now UNITY_MATRIX_I_V that you can use ![]()
I did a research and I guess that Unity3d does not give you the inverse view matrix, but it gives you the UNITY_MATRIX_V that you can access in your shader, just transpose the upper 3x3 matrix and negate the translation vector to get the inverse.
If you are trying to transform vertices in modelview/world matrix into local space of the object I guess you can use _World2Object.
– WomrwoodNo problem in doing it, cg programs have access to a function called transpose that you can use.
– WomrwoodAwesome I'll give it a go :)
– Exalia