What are the detailed diffirences between these two nodes:CameraVector & CameraDirectionVector ?

Hi, I am so confused about these two nodes: CameraVector / CameraDirectionVector, they seem to have the same function, which is: “basically this node outputs the current direction of the Camera as a Unit vector”, but when I use the DebugFloat3Values node to test their outputs, in the same direction and position, they output two different values. So as the topic asked, What are the detailed differences between these two nodes?
Snipaste_2021-08-25_14-41-02

CameraDirectionVector produces the a vector of the camera direction.

CameraVector produces a vector of the direction from the pixel to the camera. So its value is different for each pixel on the screen.

1 Like

I don’t know any text based explanations. But there’s a guy on youtube who has gone through most of the most commonly used nodes (but not these two apparently). I have not watched them so I can’t vouch for the quality.

2 Likes

Oh,it really helps, thanks a lot! So when talking to the view direction, which one should be used? or which node is equal to the View Dir node in the shader forge of unity?
Snipaste_2021-08-26_20-10-59

I’ve never used Unity so… I don’t know for sure. But the icon of that node looks like it’s probably the equivalent to CameraVector

I see I see! Thanks so much!

the CameraDirectionVector is simply the world-space direction of the camera. ie: what direction you are looking.
the CameraVector, on the other hand, is the vector from [the currently rendering pixel] to the camera. this is different for every pixel on the screen, as the pixels exist in world-space the same as the camera does, so each of their direction vectors will be slightly different.
I hope this helps:

3 Likes

The sketch map really helped! I used to think that CameraDirectionVector * -1 = CameraVector, no, it’s wrong! Thanks for answering the question in such detail!