Ray Switch


The Ray Switch node allows for different shading results on a surface, based upon the type of ray being evaluated and the direction of a given face, either front or back. This node can be used to remove unwanted reflections from inside-facing polygons, for example, or even place a different material in the refracted areas of a surface, and so on. Any of the following ray types can be used with the Opacity channel:

  • Camera Ray
  • Shadow Ray
  • Diffuse Ray
  • Reflection Ray
  • Refraction Ray
  • AO Ray

The Ray Switch node will operate only on the beauty passes. Other passes will be unaffected.

Ray Switch-光线开关 - 图1

CAMERA RAY

This ray determines the visibility of the object within the image itself. Reflections of the object will still be visible, as will shadows, and AO. If applied to the Diffuse channel, the material range will be black (0) to white (1). If color is desired, multiply the color by the node output, and then route the result to the diffuse pin of the material.

In the example below, the Checks generator has been added to the Camera Ray channel for the Specular material applied to the cone. As a result, portions of the cone are not seen by the camera and are thus rendered clear. The reflection of the cone, however, is normal. The settings for the Ray Switch node are listed in the box in the lower right of the image.

Ray Switch-光线开关 - 图2

SHADOW RAY

The shadow ray slider affects the visibility of the shadow cast from the object when the Ray Switch node is connected to the Material Opacity pin. This slider has no effect when connected to other material channels.

DIFFUSE RAY

If the material has a diffuse component, it can be modulated with the Diffuse Ray slider. Specular or Metallic materials will see no effect.

REFLECTION RAY

Reflections from the object can be attenuated via the value slider or a suitable texture. The range would be the normal reflection (1) of the surface down to a black object reflected, as opposed to the object being invisible in the reflection.

In the image below, a Checks generator has been added to the Reflection Ray, as seen in the reflection of the cone. The actual cone, however, renders normally.

Ray Switch-光线开关 - 图3

REFRACTION RAY

Refractions in the material can be attenuated via the Refraction Ray slider.

AO RAY

Any ambient occlusion contained in the shading will be attenuated by this value. Does not apply to the AO Render Pass.

Some examples of various settings for different materials are below. In all cases, the Ray Switch node was plugged into the Opacity pin of the material listed:

Ray Switch-光线开关 - 图4

Ray Switch-光线开关 - 图5

Ray Switch-光线开关 - 图6