Category: mental ray > Materials
Shader Family: Surface Material
The mip_rayswitch and mip_rayswitch_advanced utility shaders allow different types of rays to return different results. There are many cases in which this can be useful, including but not limited to:
Separating primary and secondary rays into calls to other shader.
Returning a different environment to eye rays (such as a photographic background plate for a screen background), reflection rays (such as a spherical high resolution environment to be seen in reflections) and final gather rays (a filtered environment suitable for lighting the scene).
Limiting time-consuming shaders where they are nearly invisible. For example avoiding a complicated secondary illumination or ambient occlusion shader in the refractions seen through frosted glass.
The Ray Switch shader is a simple shader that accepts a set of color inputs from other shaders to apply for certain classes of rays.

| eye |
Sets the result for eye (primary) rays. |
| transparent |
Sets the result for transparency rays. |
| reflection |
Sets the result for reflection rays. |
| refraction |
Sets the result for refraction rays. |
| final gather |
Sets the result for final gather rays, as well as any child rays to final gather rays. |
| environment |
Sets the result for environment rays. |
| shadow |
Sets the result for shadow rays. |
| photon |
Sets the result for photon rays. |
| default |
Sets the result for any other ray type. It is not a fall-through default, however, each of the above returns their respective result whether connected to a shader or not (generally 0 0 0 0 black). If you need fall-through defaults, use mip_rayswitch_advanced which is the advanced version of this shader. |