What is RaySwitch material and map?



RaySwitch Material and RaySwitch map


The Rayswitch material lets you specify different 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.



The UI of the RaySwitch material is very simple. It lets the user assign different materials to different ray types (GI, Reflection, Refraction, Direct visibility).


In this example, a blue material is used for direct visibility, a red one for reflections, and a green one for refraction. Three different materials are used. 




Likewise, rayswitch map allows for specifying different maps for different ray types. 


Similar to the RaySwitch material, the RaySwitch map allows for assigning different maps to different ray types. 


In this example, different checkerboard maps are used for reflection and refraction of a single material. Three different maps are used within just one material.





Example uses


1. Reducing color bleeding


In this example, the walls are actually white, and only the floor is covered with a red and orange checkerboard texture. The overall room gets colored because of sunlight bouncing around. This effect is usually called "color bleeding".  



Sometimes the color bleeding is not desired. We can easily lower it, or even remove it completely, by using the RaySwitch material. In this case a grey material was placed in the Global Illumination slot of the floor material. You can however see that the reflections of the floor in the walls is still orange, because only the GI rays was altered.



We can also get rid of the orange reflections by pasting the grey material into the floor material's Reflection slot. This way we end up with no visible color bleeding or colored reflections. Note that the image is not physically correct when using a setup like this, since color bleeding would happen in real life. 




2. Background material


The preferred way to create background materials (backplates) is using the Corona Light Material with "emit light" option turned off, however the rayswitch material can be used for background materials as well. The solution is to use a Corona Light Material or Corona Material with self illumination enabled for Reflection, Refraction, and Direct visibility slots, and to leave the Global Illumination slot empty. This way the background material will be visible directly, in reflections, and in refraction, but it will not cast shadows or affect GI in any way. Furthermore, by changing the reflected or refracted material, additional control can be achieved (for example making the reflections of the background in scene objects more or less prominent). 





3. Disabling shadow casting


The RaySwitch material can be used to disable shadow casting of an object. To do it, simply leave the GI slot empty. 


The figure object casts shadows and affects GI. No RaySwitch material is involved. 



The figure object has a RaySwitch material applied with the GI slot empty. It does not cast shadows or affect GI in any way. 




4. Disabling caustics


Reflective caustics are clearly visible in this example.



Caustics can be disabled by placing a material with no reflectivity in the GI slot of a Rayswitch material (in this case a completely black material was used).