About me

Translated to english with Google Translate

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.
Depending on the type of ray switching between different shaders. For example if you need to be considered a reflection, then render blue shader, and if the refraction or final gather, then red. In this case, a direct view of the shader may be a different color.
Do different color shader for reflection and refraction... certainly interesting, but why? "In everyday life" it may be useful to reduce the color bleeding, by replacing a shader for ray final gather at a less intense color. This, too, everything is fine and working, but this article will focus on the use of these shaders a bit for other purposes, such as optimizing the rendering.

The essence is very simple.
For example we have a car showroom, where there are materials leather, plastic, metal and etc.. Almost everyone has occlusion, blurred reflection, and bump. The result suits us, but we see that such a shader does not work quickly. And it would be necessary also to render the animation ...

infniti gcoupe smooth shade

To begin, we choose the complex shader, which occupies the largest area in the scene. And assign to these objects mip_rayswitch shader. In mip_rayswitch shader we connect our complex shader to main slot. Then create a copy of our complex shader, but without the bump, occlusion and reflection (usually just a lambert) and connect it to 'final gather' and 'reflection' slots. As a result, we obtain that in a highly blurred reflection, will see a simple shader. It also will be visible for FG. Since the reflection blurred, it will not be visible lack of bump, occlusion, and often even reflection on reflected objects. But if you still see places without any effect, you can leave it, but with lower quality settings, such as occlusion can put a smaller number of rays.

ray_type graph before
Original graph of complex shader

ray_type graph
Graph with mip_rayswitch optimization

rayswitch AE

This trick can be done with all the basic shaders.
As a result, can significantly reduce render times. A final gather when you use this trick often less "noisy". In this case, the result image is almost unchanged.

For example, rendering time for the next image in 1000x720 resolution decreased from 51m43s to 35m40s after using mip_rayswitch on 6 basic materials.
As we see, time has decreased by 30%. The second picture is not showing because it is practically the same.

infniti gcoupe result
Infiniti GCoupe

The final result of the animation can be viewed at
The project was implemented in order creative agency Red Keds for Infiniti.

Send your questions, and suggestions to