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
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 come here in 2023 like I did, there is now UNITY_MATRIX_I_V
that you can use
© 2022 - 2025 — McMap. All rights reserved.
If you are trying to transform vertices in modelview/world matrix into local space of the object I guess you can use _World2Object.
– SlesvigNo problem in doing it, cg programs have access to a function called transpose that you can use.
– SlesvigAwesome I'll give it a go :)
– Sall