Compositing Render Passes
Wednesday 9th Jan 2008
Making tweaks in 3D can be time consuming, making the changes in a compositing package can be quite fast. This quick tutorial will show you the benefits of rendering in layers.

Step 1 - Build a Scene
I've built a white plane that's purely for shadows, a green ball and a red teapot. I've then thrown in an area light (mental ray). By default, it'll render out looking something like this.

The reflection on the red teapot is at 100%. The ball also has a 100% reflection. I've put the specular up to be fairly matte, but bright enough I'll be able to change it later.


Basic stuff


Nasty Results

Step 2 - Setting up the passes
We're going to split the render off into basic sets. Diffuse, Lighting, Specular and Reflection.

Bring up your render panel and go to Render Elements. Add all the above passes. Select diffuse and untick Lighting.


The Render Elements Panel

In your Common panel, set a file save location. Render.

Step 3 - Rendering An Ambient Occlusion Pass
These are just always handy to have around. Bring up your material editor. Set your Self-Illumination to 100%. Apply an Ambient Occlusion shader to your diffuse.


Applying an Ambient Occlusion Shader to the Diffuse Channel


Setting the samples to 96

I've set the samples to 96 so its a bit cleaner.

Bring up your render panel, go to Render Elements and untick "Elements Active". This disables rendering in separate passes.

Go to the Processing tab, and tick "Material Override". Drag the ambient occlusion texture you just made into its map selection box.


Overriding all the scene materials with an ambient occlusion.

Head back to your Common panel and set a new file out, something like CompTutorial_AmbientOcl.tga.

Step 4 - Loading the Passes into Photoshop
Whether you're using Photoshop or not isn't terribly relevant. Copy all the layers into a single image, and select put them in the following order (from top to bottom).

Specular - Lighting (Also known as an "Additive")
Reflection - Screen (Also knows as a "Clamped Additive")
Diffuse - Normal


The scene composited without lighting

In a separate image, put the Lighting and Ambient Occlusion mix in together. I recommend mixing the ambient occlusion in at around 50%. This will obviously be a point of contention on different styles of scenes.


Ambient Occlusion with Direct Lighting


Ambient Occlusion Mixed with the Direct Lighting

Now a 50/50 mix of the two won't yield the results I've shown above. I tweaked the levels of the diffuse to have a more solid white point. (Ctrl + L, grab the right handle and pull it in some).

Step 4 - Using the Lighting Pass
Merge the lighting pass together, and put it on top of the diffuse layer with the rest of the layers. Use a Multiply mixing mode.


It should now look something similar to this.

Now, you can change the opacity of the reflection at will, you can also tweak the levels of your specular highlights.

I've decided to make the Reflection 35% opacity with a tiny blur.

Now, you can still clearly see a white plane...

Step 5 - Fixing the lighting
So the lighting looks a tad dodgey. Select your lighting pass and go to to levels, and pull the right handle inward until the background plane becomes a uniform luminance with the background.

You have now composited a simplistic scene by hand.


The basic comp

Step 6 - Hacking the Bone
The fun part! Now, if we had rendered each individual object seperatly, this would be a tiny bit easier. I was however lazy.

Select your diffuse layer and select a comical foreground colour. I've chosen some hideous aqua/turquoise. Select the paint bucket and set its Tolerance to 32. Click on the teapot.



Teapot Colour change in 0.01 seconds.

On such a small scene, I've shown you the very basics.. If you're working on a large scene, break the scene up into individual elements, and you'll find tweaking it in post a lot easier... And faster.

 

 
  ADVERTISE WITH JTBENTLEY.COM