What is RaySwitch material and map?



Tutorial: Using RaySwitchers





Rayswitch Material


RaySwitch material lets you assign different kinds of materials for different ray types (GI, reflection, refraction, direct visibility). You can use it for example to create materials invisible to camera or not affecting GI, or to reduce or increase color bleeding.



Rayswitch Material - Examples


1. Reflective object. No rayswitch material used. Visible reflective caustics:




2. Reflective object. Non-reflective material (pure black) used for GI rays. No caustics:






3. Blue material used for direct, reflection and refraction rays. Glowing material used for GI rays:






4. Blue material used for direct rays, orange for reflection and pink for refraction:






5. Object with disabled GI which also disables its shadows:







Rayswitch Map


RaySwitch map is analogous to RaySwitch material. It lets you assign different kinds of maps or solid colors for different ray types (GI, reflection, refraction, direct visibility).



Rayswitch Map - Examples


1. Red checker map used for refractions, blue checker map used for reflections:





2. Practical Usage: Corridor scene - walls and ceiling are monochromatic and slightly reflective, floor is highly reflective and saturated. We want to get rid of excessive color bleeding and noisy reflective caustics:




Floor material setup:




Wall material setup:




2.1. Rayswitch map is placed in floor material's diffuse color slot. GI color is darkened to dim color bleeding.






2.2. Then, reflection color is darkened to dim colorful reflections of floor in the walls:






2.3. Rayswitch map is placed in floor material's reflection color slot. GI color is set to pure black to disable reflective caustics:






2.4. Then, reflection color is darkened to dim reflections of floor in the walls:






2.5. Rayswitch map is placed in wall material's reflection color slot. GI color is set to pure black to disable reflective caustics:






2.6. Then, reflection color is darkened to dim reflections of walls in other objects and in themselves.





2.7. Before / After:

   

The end result, after the same amount of passes, is less noisy and renders slightly faster while preserving direct visual appearance of materials. It is not physically correct, though.