The Ray Direction node converts the direction of the incoming ray into an RGB texture (figure 1). It is primarily used for advanced procedural shading, creating custom falloffs, view-dependent effects, and non-photorealistic or technical rendering setups by reading vector data in world, object, camera, or tangent spaces. Figure 1 shows a simple node setup where the Ray Direction node is used as the diffuse color for an Octane material. 



ray direction



Figure 1: A Ray Direction node is connected to the Diffuse pin on a Glossy material node

 

Ray Direction Parameters

View Direction - If checked, the resulting vector is determined from the viewing position to the shaded point position, if not checked, the data is calculated in the opposite direction.

Coordinate System - The coordinate space used to output the ray direction.

  • World - Coordinates are calculated from the absolute origin of the scene (0,0,0).
  • Object - Coordinates are calculated by the orientation of the object on which the node is applied.
  • Camera - Coordinates are calculated from the origin of the camera's center.
  • Tangent - Coordinates are calculated across the surface of an object where x and y can be thought of as U and V (texture space) and the Z direction is each faces' normal direction.

Normalize Result - Determines whether to rempa the results to the 0 to 1 range or leave it in the -1 to 1 range.