The purpose of rendering out multiple passes is that it allows you to tweak all aspects of an image such as global illumination, direct light, diffuse, reflection, specular etc. These passes can then be compiled together in Adobe Photoshop (Fig.01).
The whole process of saving out the different render passes may seem like an extra task within your workflow, but it will save you a lot of time, especially if you wish to reduce the reflection of a material or change the color of an object. Without render passes you would end up rendering the image again and that is not the best way to go if you have a deadline looming.
V-Ray has multiple render elements - some are compulsory whereas others are not. To view a full list of render elements that V-Ray supports, clickÂ here
Before I start, I would like to point out that I will be using aÂ linear workflowÂ with a gammaÂ 2.2 setup within 3ds Max and V-Ray. I strongly recommend setting this up as it will improve many areas within your workflow. You can find an easy to follow step-by-step guideÂ here
Selecting the Render Elements
Within the V-Ray render settings go to theÂ Render ElementsÂ tab andÂ addÂ the following elements:
- VrayRawGlobalIllumination: The difference between VrayRawGlobalIlluminationÂ and VrayGlobalIllumination is that the raw version is not multiplied by the diffuse color. This allows much more control in post processing
- VrayDiffuseFilter: The pure diffuse surface color, combined with VrayRawGlobalIllumination it will give you VrayGlobalIllumination.
- VrayRawLighting: This element works in the same way as the VrayRawGlobalIllumination. Combined with the VrayDiffuseFilter the result will be VrayLighting
- VrayReflection: The reflections on the surface.
- VraySpecular: The surface specular highlights.
- VrayMtlID: As long as you have given all your materials within your scene a material ID, the resulting render element will be a mix of solid colors thatÂ correspondÂ to aÂ material ID. This can then be used to color pick areas within your render to adjust in post (Fig.02).
Providing you are using the V-Ray frame buffer, leave all the settings as they are. There are other render elements that are not included in this guide that you may need depending on the type of project, such asÂ VrayZDepthÂ for DOF,VrayRefractionÂ to control the opacity andÂ VrayExtraTexÂ combined withÂ Vray DirtÂ to create anÂ ambient occlusionÂ pass.
Additionally you can add theÂ VrayRawShadowÂ element to control the intensity of the shadows, but from experience the outcome is sometimes less than desired because of the low amount of samples it uses to calculate. Similar to the diffuse pass, the end result is not very smooth. It's best left combined with the GI and lighting elements.
V-Ray render elements also work best with V-Ray materials, if some of your objects areÂ standardÂ materials they may not function correctly as a renderÂ element. So double-check that your objects have V-Ray materials appliedÂ beforeÂ youÂ render.
Auto-Save the Render Elements
Because there are many passes, saving these out one by one is time consuming and out of the question when you are creating an animation. In the V-Ray frame buffer rollout tickÂ Split Render ChannelsÂ and choose a location to save the render passes. I recommend saving as aÂ TIFÂ file with at leastÂ 16 bit Color. This will allow for maximum range when adjusting the levels in Adobe Photoshop.
LeaveÂ save RGBÂ andÂ save alphaÂ ticked. The RGB will be the completed render, which combines all the render elements before any post-production - this is known as theÂ beauty pass. Due to the fact that you are saving the resulting image here, you do not need to specify a location for theÂ render outputÂ in theÂ commonÂ tab. Ignore the pop up warning forÂ no files saved.
At this stage it is important to note that if you are following the gamma 2.2 and linear workflow setup mentioned earlier the rendered image will appear darker in the V-Ray frame buffer because don't affect colors (adaptation only) is ticked. To see the actual result click theÂ sRGB
button in the V-Ray frame buffer during or after rendering (Fig.03).
Compositing the Render Elements in Adobe Photoshop
In Adobe Photoshop go to File > Scripts > Load files into stack. Then select all the render elements and click ok; this will add all the elements into a single work file for you. Then re-order the stack into the following:
- RGB Colour
The VrayDiffuseFilter will be used more than once and is combined with other render elements. The main purpose for the diffuse pass is to easily apply color correction and if necessary, change the color of an object completely. So that you do not have to manually adjust each diffuse pass, convert it to aÂ smart objectÂ by right-clicking the layer and choosing convert to smart object. Now duplicate the newly created smart object and place it under the VrayRawLighting so that both main light sources now have a diffuse layer toÂ blendÂ with.
To edit the smart object at any time, double-click the layer and it will open in a new window. Once completed save and close and it will automatically update the smart object and any duplicates within your composition.
Set the VrayRawGlobalIllumination blend mode toÂ MultiplyÂ and create aÂ clipping maskÂ so that the blending of the VrayRawGlobalIllumination only affects theÂ layerÂ it has been clipped with. To do this hold down theÂ AltÂ key and click between the VrayDiffuseFilter and VrayRawGlobalIllumination (The cursor will change into two circles). Repeat this step for theÂ VrayDiffuseFiltercopyÂ and the VrayRawLighting elements (Fig.04).
Group both the VrayRawLighting and VrayDiffuseFilter. Do the same for the VrayRawGlobalIllumination and VrayDiffuseFilter. Then change the blend mode between the two groups toÂ Linear Dodge (add).
Linear dodge (add) adds the color information from the blended layer and removes the black because it is seen as a value of 0 and is therefore invisible. A basic terminology is anything that adds light is to be linear multiplied such as GI complete with diffuse, reflection, specular etc. Anything that takes away light (such as shadows) is to be multiplied.
Turn on the VrayReflection and VraySpecular layers and set both of their blend modes to Linear Dodge (add) (Fig.05).
At the start I mentioned that the composition will appear darker than normal. This is because we are still working in linear space. Add aÂ LevelsÂ adjustment layer on top of the stack and change theÂ middle Input slider toÂ 2.2. The middle input slider adjusts the gamma in the image. For more information on level adjustments clickÂ here
Some gamma users have mentioned that the results can appear washed out. To correct this you can add further adjustment layers to improve the color and contrast (Fig.06).
This has been a summary of the required render elements to complete an RGB beauty pass. There are many more elements and adjustments that can be added to aid with post-processing. However, it is very much down to the type of project and the result you are after.