Compositing V-Ray Render Elements

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).

Fig. 01

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:

  1. 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
  2. VrayDiffuseFilter: The pure diffuse surface color, combined with VrayRawGlobalIllumination it will give you VrayGlobalIllumination.
  3. VrayRawLighting: This element works in the same way as the VrayRawGlobalIllumination. Combined with the VrayDiffuseFilter the result will be VrayLighting
  4. VrayReflection: The reflections on the surface.
  5. VraySpecular: The surface specular highlights.
  6. 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).

Fig. 02

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).

Fig. 03

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:

  • Alpha
  • RGB Colour
  • VrayMtlID
  • VraySpecular
  • VrayReflection
  • VrayRawLighting
  • VrayRawGlobalIllumination
  • VrayDiffuseFilter

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).

Fig. 04

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).

Fig. 05

Fig. 05

Gamma Correction

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).

Fig. 06

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.

Fetching comments...

Post a comment