Input: Camera Data
Node Interface
Overview
Function | Return information about the current view |
Nearest C4D equivalent | None |
This node is used to obtain information about the current shading point - that is, the point in the scene currently being rendered by Cycles 4D. It can be used, for example, to set up mist or Z-depth render elements.
Settings
None.
Output
View Vector
This is a vector from the camera to the current shading point, in camera space (the space is important).
View Z Depth
This is the Z component of the vector between the camera and the point (i.e. of the View Vector). In other words, the X and Y components are not taken into account. Objects in different locations in the 3D world may still have the same Z depth.
You can use this to fade in or out an object on a plane parallel to the camera. For example, in this scene note how the figures change colour and fade out the greater the Z depth is from the camera (many thanks to Paul Taylor for this scene):
The node tree to do this looks like this:
The way it works is that the View Z Depth value, suitably scaled down by the Math multiply node, drives two things: the colour returned from the Color Ramp node and the Fac value of the Mix shader, so that as the distance increases the amount of transparency also increases. This allows objects to fade out with Z depth.
View Distance
The actual distance between the camera and shading point. This is subtly different to View Z Depth because objects with the same Z-depth may not be the same actual distance from the camera. With View Distance the distance is from the centre of the camera moving radially outwards. The distinction is subtle but important and produces a result like this:
Note for example how the edge of the Plane object the figures are on seems to curve at the farthest points rather than being straight as in the View Z Depth example. The node tree is exactly the same except the View Distance port is linked to the Math node instead of View Z Depth.