Shader Node ViewDirection vs Camera Direction?

Anyone knows what’s the difference between the View Direction Node and the Camera Direction in the Camera Node. The Camera Direction looks like the orthographic version of View Direction

I read the documentation it shows the code, but I don’t understand the Camera Direction Node part. Does anyone know about it:(?

https://docs.unity3d.com/Packages/com.unity.shadergraph@11.0/manual/Camera-Node.html

float3 _Camera_Direction = -1 * mul(UNITY_MATRIX_M, transpose(mul(UNITY_MATRIX_I_M, UNITY_MATRIX_I_V)) [2].xyz);

I’m pretty sure that the camera direction is literally the forward vector of the camera (in world-space), while the view direction is the vector from a fragment’s position to the camera’s position. So the camera direction is the same for every fragment, while the view direction is different for every fragment. They also point in opposite directions (the camera direction pointing away from the camera, and the view direction pointing towards the camera).

1 Like