Rendering on VRay on Renderman principles

    As we know now, there are only two key software render it’s VRay and Renderman. Just recently there was even and mental ray, but he is already 4 years both dead and not releasing new versions, only occasionally to give the illusion of life assigns numbers without having absolutely no functional, that is why we will not consider it. So here in this article I want to consider the key differences between Vray and Renderman.

    VRay render is very young, it was originally written as a plugin to a trace of light, but later authors have understood that they have turned out to be not just a plug-in, and the fastest of all existing tracer (even to this day). Then from the plugin simply render quickly grew, which is still in alpha version everybody liked. And in a very short time was able to overtake all the popular Vray raytrace renders and became the standard in many areas, and is now slowly but surely is grabbing the last industry, production.

    And thanks to the release of field of mental ray, he is good at it. Now in VRay we boldly take a trace for the calculation of reflection, refraction, SSS and GI. But on the contrary, the old render is Renderman, was written in the days when computers were extremely weak and unable to be traced rather nothing at all it was very long. And to simulate natural light used all sorts of tricks with the light. It has been 25 years and Renderman is still based on the same principles, but have very interesting technology to simulate tracer effects, a tracer from the Renderman does not itself been trying, though it is, but it works very slowly. In this lesson, you just want to look at how to make beautiful lighting without using GI, as is the case in Renderman. Because the article is at all and refers to general principles, there will be no deep immersion in technology and banal peredergivaniâ technologies. The principles take on Renderman technology take on VRay. As these principles then can apply in any other program, photoshop, mudbox, fusion and others. In addition, without GI the animation much easier to count on a render farm.

    Light on interior

    Let’s start with the most common method of VRay-interiors visualisation. Try going on a free stage from Evermotion(download here).To begin with, just peregonim the scene in our version of 3DS MAX and VRay. The easiest way to do this via a Merge into a new stage of the whole content of the file, thus we have the same scene but with absolutely pure render settings. Now we set the scene for himself, for that I have reflective items increased to 32 sampling reflection, global lighting default with high settings, gamma settings max 2.2, other settings made such:

    Настройки Рендера

    Render setup

    Then displays and look what happens when rendering with global illumination.

    Рендеринг с глобальным освещением

    Rendering with global illumination

    Total was very cute picture rendering which on my computer it took 32 minutes. But in this way rendering there is one minus, it is very hard to find animation, global illumination with little care is known to be noisy, and even harder to find if there are animated objects in the scene or the characters, and most have an incredible task to count such Tween to render farm. And how is this done in Renderman? In order to help you understand we do not dive or in thickets or Renderman technology complex technologies VRay.Turn on one of the many options for dealing with this problem, the simplest. And then based on this knowledge, you will be able to apply more advanced techniques, each in their abilities.

    Remember those days when even the objects were simple three sources of light? No? You are lucky! But a similar principle applies only to the Interior. Existing sources of light can be turned off, or not yet remove, disable global illumination. Rendering without global reporting we’ll go back through, first, we will configure simulation of global illumination, and then very light. This is just a simple evenly arrange the Interior lights, Omni for the first time to easily configure more rip through the Instance. Lights on the Hill have to taste, easier to customize start from the middle. I was like so.

    Расположение источников света

    Location of light source

    The location can be a wide range, to any taste and color. To evaluate the existing result will Overid light gray material and rendering the picture, you should have something like this.

    Предварительный рендер

    Preview render

     And as you can see half of the work has already been done, we have a very nice emulation of global illumination. Just set it up, first shadows too sharp, simulation of global reporting should not be too bright, it shouldn’t be a single color throughout the area, it doesn’t have to be one of intensity throughout the area, i.e. sources located near Windows should shine more brightly and be closer to the color of the lights outside the window, located further from the window should shine weaker and have a tint of surrounding objectsas if you are simulating specular painted beam. Well and in the end when settings will be completed, you can increase the sampling from the shadows to 32 and count to see what we have.

    Финальные настройки света

    Final setup of light

    Now that we have configured the simulation of global reporting you can turn off the Overid materials, light sources and return to Windows. Finally, you can try to count the final picture.

    Почти финальный рендер

    Almost final render

    Here is my picture almost ready, left her very small scale until configure, you must first remove the white photos of from Omni, for this in their preferences is unchecked Specular. Also if you compare to the picture which has a global lighting, you’ll notice that in this picture much more grey. For the final setting is the time to make a few sources of unique and customize them to your liking, for example those sources that further from the window will be darker and light red areas and those near the window and a blue posvetlee.

    Финальный рендер интерьера

    Final render of interior

    That’s all. Our interior is ready. And as you can see he is almost worse Interior that was counted with the global illumination. As less time to increase render time 45 minutes on my computer. We can now as a plus to animate in this scene everything and anything, and find without prior preparations, you can simply send the scene immediately to hundreds of thousands of machines at render farm. And you won’t have absolutely no noise.

    And now why I chose this principle. It is universal for all 2.5 D and 3D programs. I specifically did not complicate the complex elements that all could understand and apply in any other program, and later as available knowledge to optimize this behavior to reduce render time, i.e. you can have to the same scene was in 3 times faster, that is 20 minutes on my computer. In addition it is one of the basic principles of getting Interior in Renderman.

    Кольцо отрендереное во Fusion

    Ring renderable in Fusion, Author

    And this is an example of what can be achieved in the program compositing Fusion intelligently with lights all on the same principle. In the program there is no trace of this reflection and  refraktion, there is no trace of shadows. At the entrance was a simple geometry, without materials, here is such a beautiful picture.

    Light on exterior

    The exteriors being the case even easier. Exterior lighting quality for just two light sources. The first will simulate a diffusely of the second environment will simulate the Sun. For example, thought that the town or countryside, ultimately got universal scene where there are buildings and vegetation, scene from free Evermotion (part 1 and part 2).

    To begin the drag everything into a new blank scene and make the same settings that were doing in the Interior, just do not forget copied part of an old scene VRay settings manually. This time I didn’t interrupt sampling materials and light on 32, and instead made Adaptive DMC min 10 max 50, it’s far more lavish to time render method, but won’t bother with this now. Displays and look what we have in the global lighting enabled.

    Экстерьер с глобальным освещением

    Exterior with the global illumination

    The graphical features is a beautiful picture that we will continue to navigate. As I said on the outside is much easier, in fact, all that needs to be done in this scene off global illumination and emulation. For convenience and easy understanding disable all the light in the scene, not delete, it still comes in handy, and turn off all global illumination. To simulate global reporting will use a VrayLight in Dome mode. As a texture for the light source will use HDRI who was in Environment for simulating global illumination. To do this, simply drag it from the environment to the light source texture slot. Displays and look at the resulting product.

    Симуляция глобального освещения

    Simulate global illumination

    And as you can see this method worked perfectly. Now we have a simulation of global reporting is just as great as this global coverage. Left to do small settings for brightness, semplingu and other improvements to your tastes. That would highlight the too dark places, and at the same time give a color picture can be used with small values of the AmbientLight intensity. After all, you can return the rest of the lighting in the scene and render it.

    Экстерьер без глобального освещения

    Exterior with out global illumination

    In the end it turns out the picture which is not worse than the image that was calculated with this global illumination. And to achieve this effect, we need not so much, just to replace a simple global illumination light source. As a plus, we again can easily animate anything in this scene and immediately without prior training, send to the farm take long though for thousands of frames of animation.

    Note: the installation of Adaptive DMC min 10 max 50 was not the best solution, out of a desire to simplify the sample on your material and light, very much increased time render, with 40 minutes to 10 hours. Much more economical way is to install the Adaptive DMC min 1 max 4 and personalized sampling of each material and a light source. In such a case, the render time is not exceeded and 1 hour. Also as you can see in the picture a bit differently behave leaves, but this is a small matter to material under a specific type of lighting.

    Write a shaders VRay 

    Who says that you can’t write a shader for VRay? In fact, you could always. Available in Vray shader cover 99% of all cases, and even in their latest projects at Pixar went on VRay, as I’m a shader which covers 99% of materials. But if you hit the 1% of the time then this section is for you. In Vray 1 version was enough to open the best development environment Microsoft Visual Studio “delay” in the SDK to write a shader VRay for VRay in C++ and use it as you see fit. And for writing shaders do not need to learn a new programming language, the programmer can write a long familiar C++. Examples of these shaders are available in VRay SDK

    In 2-nd version of VRay this process much easier, even. Introduced support for GLSL shaders. We recommend that you read the manual before use because VRay GLSL is different from OpenGL GLSL system variables, such as color, position, normals, and other. For example, here is a simple code with a simple model ŝejdera blackout and lights, the simplest example is taken from the official guide.

    #version 110

    uniform vec4 diffuse_color = vec4(1.0, 1.0, 0.0, 1.0);

    uniform float diffuse_scalar = 0.7;

    uniform vec4 specular_color = vec4(1.0, 1.0, 1.0 ,1.0);

    uniform float specular_scalar = 0.06;

    uniform float diffuse_deviation = 0.5;

    uniform float specular_shininess = 10.0;

    float orennayar_diffuse(vec3 light_dir, vec3 view_dir, vec3 normal) {

    float sigma_sqred = diffuse_deviation * diffuse_deviation;

    float A = 1.0 – (sigma_sqred / (2.0 * (sigma_sqred + 0.33)));

    float B = (0.45 * sigma_sqred) / (sigma_sqred + 0.09);

    float cosThetaI = dot(light_dir, normal);

    float cosThetaO = -dot(view_dir, normal);

    float sinThetaI = sqrt(max(0.0, 1.0 – (cosThetaI * cosThetaI)));

    float sinThetaO = sqrt(max(0.0, 1.0 – (cosThetaO * cosThetaO)));

    float cosPhiI = dot(light_dir, vr_TexTangent);

    float cosPhiO = -dot(view_dir, vr_TexTangent);

    float sinPhiI = sqrt(max(0.0, 1.0 – (cosPhiI * cosPhiI)));

    float sinPhiO = sqrt(max(0.0, 1.0 – (cosPhiO * cosPhiO)));

    float temp = max(0.0, (cosPhiI * cosPhiO) + (sinPhiI * sinPhiO));

    float sinAlpha;

    float tanBeta;

    if (cosThetaI > cosThetaO) {

    sinAlpha = sinThetaO;

    tanBeta = (sinThetaI / cosThetaI);


    else {

    sinAlpha = sinThetaI;

    tanBeta = (sinThetaO / cosThetaO);


    float result = (A + (B * temp * sinAlpha * tanBeta));

    return clamp(result, 0.0, 1.0);


    float phong_specular(vec3 light_dir, vec3 view_dir, vec3 normal) {

    vec3 reflection = reflect(view_dir, normal);

    float cos_rl = clamp(dot(reflection, light_dir), 0.0, 1.0);

    return (pow(cos_rl, specular_shininess) * (specular_shininess + 2.0));


    void main() {

    vec3 normal = (gl_FrontFacing) ? vr_Normal : -vr_Normal;

    vec4 diffuse = vec4(0.0, 0.0, 0.0, 1.0);

    vec4 specular = vec4(0.0, 0.0, 0.0, 1.0);

    vec4 diffuse_contrib = vec4(vec3(diffuse_color) * diffuse_scalar, 1.0);

    vec4 specular_contrib = vec4(vec3(specular_color) * specular_scalar, 1.0);

    vec4 temp = diffuse_contrib + specular_contrib;

    float max_color_component = max(max(temp.r,temp.g),temp.b);

    if (max_color_component > 1.0) {

    diffuse_contrib.rgb /= max_color_component;

    specular_contrib.rgb /= max_color_component;


    vec3 view_dir = vr_Direction;

    vr_LightIterator lightIter;

    for(int i = 0; i < vr_NumLights; ++i) { vr_evalLight(i, vr_Position, normal, lightIter); float cos_nl = clamp(lightIter.dot_nl, 0.0, 1.0); if (cos_nl > 0.0) {

    float diffuse_term = orennayar_diffuse(lightIter.direction, view_dir, normal);

    diffuse += vec4(vec3(diffuse_term * cos_nl) * lightIter.contribution, 0.0);

    float specular_term = phong_specular(lightIter.direction, view_dir, normal);

    specular += vec4(vec3(specular_term * cos_nl) * lightIter.contribution, 0.0);



    diffuse *= diffuse_contrib;

    specular *= specular_contrib;

    vec3 gi_contrib = vr_irradiance(normal, 1.0);

    diffuse += vec4(vec3(diffuse_contrib) * gi_contrib, 0.0);

    gl_FragColor = diffuse + specular;


    All variables which are declared via the Uniform we then can set in material editor. As a result, the graphical features of the image is us

    Работа GLSL шейдера

    Work GLSL shaders

    As you can see on a colored object with the graphical features of the shading and highlights. Standard material which is 100% wit the shader itself there are no glow and glare. Why the shader is executed as a separate card will explain in the next section, so it is much more versatile than just material.

    And now what pluses GLSL. First is the standard for all shaders, including gaming for OpenGL, and thus has a large number of examples, we only have to remember to change system variables. Second for writing shaders, you can use the Visual Studio. In addition there are many node tools for creating shaders such as MentalMill and similar tools from NVidia. And, soon, such tools will be already built into the 3DS MAX.

    Mental mill

    Mental mill

    And now the fun part. Renderman Shading Language uses the same with similar language for shader, except again system variables and syntax elements, C differs from C++. And in fact absolutely any shader from rendermana you can easily change the shader VRay, just change a few variables and change the syntax. Of course it works in the opposite direction. In principle this procedure can be achieved even in automatic mode.

    Getting the desired layer VRay

    In this respect, VRay again everything just perfect compared to Renderman. Main chip than proud people rendering in Renderman is an object that you can hang any parameter, then this parameter drive in a separate layer, i.e., the layer you can pull out all that you want. Actually there is VRay and even more the same. With regard to pull out anything in a separate layer in VRay is realized through the layer VRayExtraTex. For example must be the exact same picture, but did not know which of the three to six textures will be applied later, or if you want to have multiple independent textures at the same site, to the use several layers of VRayExtraTex and each has its own texture, is hung up you have in each layer at a site will have their own texture, and all this in a single pass, without increasing the render time. Also in VRayExtraTex you can get for example map VrayDirt and then in a separate layer is AO.

    Настройка слоев

    Setup layers

     And now with regard to pull into a separate layer of anything unusual. For example, you can take your difficult material and pull out any part of it in a separate layer or for example that if you hit the 1% and you want to pull out what no, here again we use the GLSL shader samopisnogo ready, it too can pull in a separate layer, and inside the shader may be all that you wanted to record there. That is why a shader to write better as separate cards, not materials, so you can achieve maximum performance and eliminates the need to take it to the same layer, for example there is no need to consider the same shadows or speculars twice.

     And now the huge benefits of layers VRay not found in Renderman. It cannot be said that they do not, because they can add render time, and then grow to, may even at times and dozens of times. And that’s the whole charm of segments of VRay with anything you can pull from there almost without increasing time render time or increasing its not much.

    Полученые слои за один проход

    Recorded layers in a single pass

    For example, coverage of each light, including global, save in a separate layer. And then the compositing solve the brightness and color personalized for each light. Including such variants as how one fully illuminated scene with internal and external lighting, and the compositing is solved will it day or night, morning or evening. All practically without increasing the render time, and here is the Renderman for each layer will need time to render +50% with each light. In addition there is another chance to pull a layer, write it yourself via VRay SDK. In this case, there is even easier to pull out the most incredible things, like I’ve seen cases where the layer drawing options and animating cameras, lighting, all support options, and then in kompoze 3D settings to reproduce the scene through this layer. Or for example, you can display the texture density diagram to see where the texture is not sufficiently detailed and increases it can razmazat′sâ, or layer which will indicate when the software render every pixel to optimize critical materials and settings.


    Article has turned out great though, but this is just a starting point in order to more effectively apply the principles of Renderman in other programs. I do not encourage entirely abandon the principles of VRay, but it seems most have forgotten where it all began and now face some difficulties in the work. In addition, this article shows that between Renderman and Vray and not such a big difference, as some people like to tell about it, in fact it is very slow in Renderman, tracing and to dampen this effect as what you invent a lot of alternative technologies, which can be used smoothly in other programs where as no trace, for example kompoz. And we can already use these technologies. I hope this article will help many people to cope with difficulties and inspire them to new exploits.

    Happy END

     If you liked the article, you can help expand it by clicking like on your social below, and if it brought you benefit or profit, and you want to thank the author, or inspire me to new more interesting articles you can make a donation. All the collected money will go to improving the site and meet their own needs.

    5th April 2012 Articles, Home

    Leave a Reply