Quantcast
Channel: MintViz Workshop » V-Ray
Viewing all articles
Browse latest Browse all 18

Compositing the V-Ray render elements using Adobe Photoshop

$
0
0

VRay_Compositing_00
A complete rendered image is made up of various individual layers called render elements. Each element corresponds to a specific property such as illumination, shadow, reflection and refraction. By rendering out each of these elements as a separate image file, you are able to individually control every property. You can tweak the intensity of a reflection, change the diffuse colour and even adjust light intensity. This tutorial will cover the necessary render elements of this tutorial that make up what is commonly referred to as, the beauty pass and show you one of the many ways to composite them using Adobe Photoshop.

There are a few settings that need to be set in render to render out each element correctly. One incorrect setting could cause the composite to not match the intended beauty pass. Firstly the render elements must be saved in linear space. This is because when compositing in Adobe Photoshop or After Effects the calculations are also done in linear space. Any other gamma value would cause the render elements to be incorrect. However for calculating accurate lighting and materials, you should always use gamma 2.2.

Set up your scene using gamma 2.2 but render out as linear for correct compositing

VRay_Compositing_01

In render setup under colour mapping, set the type to linear multiply and the gamma to 2.2, then tick don’t affect colours (adaptation only). During the rendering process V-Ray will be using gamma 2.2 correction, but when it comes to saving out the image V-Ray will save the elements as linear (gamma 1.0). Later on, you will add gamma correction to the final composite to bring it back to gamma 2.2.

Selecting the correct render elements for compositing

VRay_Compositing_02

In render setup, go to the render elements tab and click add. Holding down the Ctrl key, choose the following render elements and click OK.

VRayDiffuseFilter
VRayRawGlobalIllumination
VRayRawLighting
VRayReflection
VRayRefraction
VRaySelfIllumination
VRaySpecular

The reasons for using Raw are so that you have ability to adjust the diffuse colour separately. Of course if you do not wish to adjust the diffuse you can use the VRayGlobalIllumination and VRayLighting elements instead.

Auto save the render passes using the V-Ray Frame Buffer

VRay_Compositing_03

In render setup, go to the V-Ray tab and click to enable the V-Ray Frame Buffer. Scroll down to where it says split render channels and tick save separate render channels. Untick save alpha as it is not needed but keep save RGB ticked so you can compare the composite against this. Click browse and point to a location to store the render elements. Choose TIF as the image file type and set it to 16-bit colour. Saving in anything less, such as 8-bit or a lossy compression type such as JPEG will mean too much colour information will be lost and the composite will not be correct. You can choose to save out as 32-bit colour which greater improves the accuracy but this will mean larger file sizes. In most cases using 16-bit is adequate. Because you are saving the rendered images via the V-Ray Frame Buffer there is no need to use the 3ds Max render output.

Finally click render and you will notice in the V-Ray Frame Buffer you can view each individual render element in the drop down list that is located top left.

To composite the beauty pass the elements must be in a particular order

VRay_Compositing_04

Open all the render elements in Photoshop as a layered PSD. Convert the VRayDiffuseFilter layer into a smart object and then duplicate it, this will make it instanced copy. Place each layer into the following order:

RGB Colour
VRaySelfIllumination
VRaySpecular
VRayReflection
VRayRefraction
VRayRawLighting
VRayDiffuseFilter Copy
VRayRawGlobalIllumination
VRayDiffuseFilter

Now each layer must be blended into the layer below to complete the beauty pass. Some layers are multiplied and same are added. As a guide anything that contributes light should be added and anything that takes away light should be multiplied. Group the VRayRawGlobalIllumination and the VRayDiffuseFilter layers and call it Diffuse + GI. Then group the VRayRawLighting and the VRayDiffuseFilterCopy layers and call it Diffuse + Light. Finally apply the following blending modes to each layer and group:

RGB Colour – Normal
VRaySelfIllumination – Linear Dodge (Add)
VRaySpecular – Linear Dodge (Add)
VRayReflection – Linear Dodge (Add)
VRayRefraction – Linear Dodge (Add)
Diffuse + Lighting (Group) – Linear Dodge (Add)
VRayRawLighting – Multiply
VRayDiffuseFilter Copy – Normal
Diffuse + GI (Group) – Normal
VRayRawGlobalIllumination – Multiply
VRayDiffuseFilter – Normal

You can now toggle between the RGB Colour element and the composite below to make sure they match.

Add gamma correction to the final composited image

VRay_Compositing_05

To complete the image a gamma correction needs to be added. In the layers panel, add a levels adjustment and set the middle slider to 2.2.

Useful Tips

Use VRayWireColor element for simple selection

VRay_Compositing_06

Providing each of your objects in the scene has a different wire colour you can use the VRayWireColor element as a selection mask in Photoshop.

View the gamma 2.2 version inside the V-Ray Frame Buffer

VRay_Compositing_07
By default, the V-Ray Frame Buffer is showing the result in linear space, to view the result with gamma 2.2 correction during rendering click the display colours in sRGB space button.

Quickly load the elements as layers in Photoshop

VRay_Compositing_08

In Photoshop go to file and scripts, then choose load files into stack. Browse and select all the render elements and click OK to automatically put each element into layers.

Watch the video tutorial


Viewing all articles
Browse latest Browse all 18

Trending Articles