Ledin Pavel takes a look at using the MIP_Rayswitch Mental Ray Production Shader in Maya to optimize renders. The mip rayswitch and mip rayswitch advanced utility shaders allows 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 (i.e. a photographic background plate for screen background), refection rays (i.e. a spherical high resolution environment to be seen in reections) and nal gather rays (a ltered environment suitable for lighting the scene).
  • Limiting time consuming shaders where they are nearly invisible (avoiding a complicated secondary illumination or ambient occlusion shader in the refractions seen through frosted glass)

“One simple, but it is a very effective method for optimizing the rendering is to use a shader type mip_rayswitch. There are a few of these shaders, for example mip_rayswitch, mip_rayswitch_advanced, p_ray_type, ray_rype and ctrl.rays. But the essence is not changed, they all work the same way.”