what the difference between model_View_Matrix and Model_Matrix

as written here
http://docs.unity3d.com/Documentation/Components/SL-BuiltinValues.html

float4x4 UNITY_MATRIX_MV
Current model*view matrix

float4x4 _Object2World
Current model matrix

my question seems a basic one in OpenGL but I am new and not sure where to find the difference
an extensive explained reference will be appreciated

Cheers :slight_smile:

1 Answer

1

So:

UNITY_MATRIX_MV Convert the model to the view - as in the Camera is at 0,0,0

UNITY_MATRIX_MVP Convert the model to the projection - including the Camera clip planes, field of view etc

_Object2World Convert the model to the World coordinates - the model vertices are in local coordinates, afterward the position multiplied is in world coordinates

UNITY_MATRIX_IT_MV Inverse of the MV matrix - used to convert normals (directions) to the view

Check out the Noobs Guide To Shaders on Unity Gems. That has links to a lot of reference works I found too.

–

OK Thanks a lot

–

If it works out for you, don't forget to tick the answer :D

–

of course :D

–

I think I did use it in Visual Studio, yes. However, even if it shows an error in VIsual Studio, it should still be able to compile in Unity (different compiler chain). So try making the change anyway, and seeing if it works. If not, then are you sure you're using the exact DLL I referenced? If you are, then it may just be that they updated the code somewhere -- I haven't used Unity in months so I don't know if this approach works with the latest versions. (I know it worked earlier since I relied on it heavily for certain debugging tasks)

–