Compositing Techniques



Digital compositing is the process of digitally assembling multiple images to make a final image, typically for print, motion

pictures or screen display. It is the evolution into the digital realm of optical film compositing (Wikipedia)

Compositing is a very important aspect of CGI work. In a production environment, you rarely use a straight raw render.

Compositing can be helpful to speed up the rendering process and give a richer result at the end.

Here we will use Blender Compositing Nodes with the renders provided by Yafaray to compose our work.

For still frames you can also use Photoshop or Gimp and for animations, After Effects for instance. 

Currently, Yafaray can't render different passes, like Blender, but there are some tricks that could enhance your work.


1. Compositing of a clay render with a GI render.

Q: Why would we render a picture twice, because it's time consuming?

A: Composite two lighting methods here can bring the better of each one.

A clay render with Ambient Occlusion brings an homogenic render with a big contrast between lights and shadows.

A GI one brings subtle lights and colors variation. The mix of the two pictures may help to have a better definition

while keeping color bleeding.

Scene provided by Gabich Scene provided by Gabich

Top: a pure Photon map render. Bottom: a photon map render composited with an AO render.

In this scene provided by Gabich, the compositing was made with an Ambient Occlusion pass, the result wouldn't have

been so different with a clay render because the picture is almost monochromatic, and it was important here to keep

the glass informations. Here, the Ambient Occlusion was mixed with an Overlay Node at Fac: 0.35. The blending mode

can differs depending on your scene. Gabich used in his own work for this scene a Mix Node at Fac: 0.5.

You can see his work here.


We will see now how to work compositing with Yafaray renders and Blender Compositor. 

Let's start with a simple interior scene: a kitchen. Modeled by Jeremy Bim for the CG Society lighting challenge.

You can find other good scenes here:

At the end of this tutorial, you can find the blend file of the kitchen uses for the following renders, with the textures from

CG textures:

This kitchen example is poorly lit and textured, it's just here to show the method.

This scene was rendered twice: first a clay render (check the tutorial for more informations).

A clay render of the kitchen

Direct Lighting settings of the clay render

The second render is a Photon Mapping one, a method of lighting generally used for interior lighting.

Photon mapping light of the kitchen.

Photon mapping settings

Theses settings may vary according to your scene. I had noise on the floor that I removed with an image editor.

You can save your renders in different formats with Yafaray (.jpeg, .bmp, . png, . tiff, .exr).

Save them in .exr. I have saved them with Alpha (so the sky doesn't appear) in order to composite a background later.


We will then import our two different renders in the Blender Nodes Compositor.

In the compositor window, add two inputs (Add > Input > Image), and load your renders. To associate these two images we need

a mix node (Add > Color > Mix). Connect the two inputs to the Mix Node, the clay render must be on top, so, logically, connect it to

the bottom socket of the mix node (yes, the bottom one). The Fac. value changes the blend between the two pictures. Fac = 0

means a pure Photon mapping, and Fac = 1 means a pure Clay render.

Here we decide to use the clay render to bring more shadows, so we will change the Mix Node to a Mutiply one. Select the Multiply

blending mode on this node. Then, to view the result, Add > Output > Viewer, and press Backdrop to see the result behind the nodes.

Play with the Fac value to find a good setting (usually 0.5 > 1). Your node setup should look like this:

Use the Multiply Node

And the result: 

A composite of clay render and PM render

Of course, it's subtle. You may want to compare the two images to see the difference. Changes are more visible with a bright scene.

2. Add a light bloom

There are several techniques to add some glow in compositing. Here's one: still in the node compositor, we will add a few nodes

to the previous set. The goal is to mix two “passes”. The first one is our previous result, the second one is the same one desaturated

(this step is optional) and blurred. We will need four nodes for that.

Select our Multiply Node for automatic connections between nodes. First, add a Hue Saturation node (Add > Color > Hue Saturation Value),

then add a Blur Node (Add > Filter > Blur), then a Bright/Contrast Node (Add > Color > Bright/Contrast) and finish by a Mix Node

(Add > Color > Mix). Reconnect the Bright/Contrast one to the bottom socket of the Mix Node. Connect the exit socket of the Multiply Node

to the top socket of this Mix Node. Change this Mix Mode to Overlay. Your Node setup should look like this:

Bloom Node Setup

Change the node values according to this picture. The Fac. value of the Overlay Node will vary the bloom effect.

Here I desaturate the pass because I just want the Black and White values to modify the bloom, but you can leave

as it is, the color will become very vivid at the end, due to the Overlay mode. The Blur will make the bloom. The

Bright/Contrast is to boost the result.

And here is the result:

Kitchen bloom

Note: to save an image from the compositor, you have to add a Composite node (Add > Output > Composite) at the end.

Then, render this image with Blender as usual (F12) and save it (F3).


These are just simple examples of compositing. I'll add more tips here later.

The blend file contains no textures.

blendfile.zip2.51 MB