This tutorial shows how to use RenderElements created by RichDirt in Photoshop. It shows the basics of compositing with Photoshop and V-Ray.
The tutorial shows how to solve 4 major hurdles in the workflow, 1 in V-Ray, 1 in 3ds Max and 2 in Photoshop.
You split a rendering in several elements and then re-add these elements in Photoshop. The advantage is that you can easily control color and intensity of layers. Adding images in Photoshop is real time, you don´t need to re-render for 1 hour to get a change in your images. This can be up to 1000 times faster than simple re-rendering ! And it offers much more artistic freedom.
The tutorial is organized in 2 sections:
An image of our example scene - without dirt : It uses 3 concrete cubes on a floor. The size of the cubes is around 200 cm (80 inch). There is 1 mirror sphere, to cover reflections. The background uses a procedural sky.
They are found in the rendering dialog, in the ´render elements´ tab. Non-English versions of 3ds Max might have different translations, but the position of the tab is the same.
We want to separate lighting (illumination) from textures.
This means we need Global Illumination (gi) also known as ´Indirect Illumination´ - without- textures.
We also need Direct Illumination -without- textures.
Then we also need the textures without any illumination.
Why separating illumination from textures ? We want to change the diffuse texture later !
Diffuse - VrayDiffuseFilter
Direct light - VRayRawLighting
Indirect illumination - VRayRawGlobalIllumination
Background (sky) - VRayBackground
Reflections - VRayReflection
For Indirect illumination use VRayRawGlobalIllumination. Do -not- confuse this with VRayGlobalIllumination. For VRayReflection do -not- use the raw reflection (VRayRawReflection), it would be to strong.
You need to export images using gamma 1.0.
You need to store global illumination (gi) and direct illumination (di) as -exr-,
with 32 bit per rgb. 16 bit and 8 bit would cut colors.
Using jpg (8 bit) will give a wrong result in Photoshop when adding gi to di. (When adding gi + di Photoshop clips values above 1.0 (white) so a part of the illumination is dropped).
When exporting .exr from 3ds Max, choose 16 bit (half float). Photoshop can handle this and shows it as 32 bit. If you export .exr as 32 bit on the Max side Photoshop pretends to be able to handle it, but it shows a broken image instead.
The 5 Render Elements :
Result - we get the exact same image as inside 3ds Max. So the compositing worked ! If you get a different image, check again that you exported the images from 3ds Max using a gamma of 1.0 and used 32 bit in Photoshop. Note: the tutorial was done with a NFR version of V-Ray, which adds a watermark.
Now let us start with the second section of this tutorial - how to add dirt:
a) Create the first VRayExtraTex RenderElement
b) Add a RichDirt texture to it.
Drag the texture into the material editor to edit it.
Use the 'Rich Building preset'.
If this is too fast (not enough details in the tutorial - see the video tutorial how to create a single dirt Render Element. The video has more details.
c) Create a second and third VRayExtraTex RenderElement
d) Add RichDirt with preset 'Splashes (variations)' and 'Building edge streaks'. Render - you now should get the following 3 images:
Why to use the Object ID ? Use this to split your scene into objects that get dirt, and objects that should not get dirt. Assign an object id to the objects that you want to be dirty.
The Render Element would render black on black if you do not assign object ids, by default 3ds Max doesn´t add ids.
To assign object ids:
What is the ObjectId Render element good for ? It will be used as a -mask- in Photoshop. This is very attractive and fast when you have a larger scene, like 1000 cubes, and you want dirt only added to 227 cubes. Object-ids can be assigned to all selected objects, so you can use max groups, layers, and more to quickly select objects, and then add 1 id to all of them.
This creates combined dirt. RichDirt uses black and white colors by default so multiplying layers is easy.
Let us have a quick look at the delicious dirt:
Dirt is added to -all- the geometry, including the ground plane. (Note that one can use RichDirt also as a texture, then each material can have different dirt. Per-material-textures can also write to a RenderElement, see the Reuse/Store tab of RichDirt´) When we later mix this with the diffuse texture we do -not- want dirt on the ground plane. So we need to mask it.
In your renderings you might not have a ground plane. So why is this covered so much in this tutorial ? The ground plane is an example for all geometry that you want to keep free from dirt. When you have a large model 1000s of objects might need dirt and other 1000s of objects do not want dirt. The approach described here solves this for you.
Photoshop masks typically are created manually, by hand painting / deleting areas with a brush, or with the lasso tool. For RichDirt we do -not- want any hand painting, we want a faster solution. Photoshop does -not- allow to directly specify a black-and-white image as a mask. Instead the following steps are required:
Now you have an image that can be used similar to a mask..
a) Paste it into ´All together´ on -top- of the 3 dirt layers.
b) Set the mode to ´Lighter Color´.
Why ´Lighter color´ ? The inverted mask is white for all objects that should not get dirt. By using lighter color white will win over the medium gray ground plane, as white is ´lighter´ than gray.
Name this group ´Dirt Effects´. The object id mask must be inside the group, so it is only applied
to the dirt.
The huge advantage of using a group is that we can control weights (opacity) of streaks, splashes to get exactly the amount of dirt we want in our scene. This is essential to get the big speed-up compared to re-rendering.
The fun part is to adjust the weights (opacity) of streaks, splashes to get the exact amount of
dirt you like.
To make sure you see the full setup here is a snapshot of the layers in Photoshop. Check this when you think you missed a step somewhere in the tutorial.
Also check if your layers are still in 32 bit. When converting a single layer to 16 bit Photoshop sometimes converts all layers to 16 bit.
Compositing in Photoshop is very fast, so why doesn´t everybody use it -all- the time ? At edges of objects (masks) one can easily get aliasing. To minimize this assure
The compositing set up above uses multiplication, which makes things -darker-. This is often perfect. But sometimes you want dirt that has a different color, like greenish moot, or brown rust. To achieve this do the following steps in Photoshop
The dirt group with a green tint
Moot on concrete