Products › BaseNode Packs › Compositing Pro › Tutorial: The final shot

The final shot

A square at dusk, rendered once by Cycles, then finished in the compositor the way a Nuke artist would: the render taken apart into its passes and put back together, a light added, haze, glow, grain and a grade. The 3D scene is never rendered again. Every change on this page is made after the render, in a few seconds.

The same dusk shot of a sphere, crates and lamp posts on a square: on the left the plain render, flat and grey; on the right the finished shot, a blue sphere, haze on the buildings, glowing lamps, grain and a warm grade
Left, the render as Cycles gives it. Right, where we are going. Seven steps, each one a few lines more.

You will learn

Before you start

You need Blender 5, the Base Node add-on, version 0.13.1 or later, and the Compositing Pro pack, which carries three of the modules this tutorial uses. The steps are free to read and to copy; the modules they call are not. If .bn is new to you, start with Lunar ground: it shows the language one line at a time.

ModuleComes withWhat it gives
passesCompositing ProThe beauty rebuilt from Cycles' light passes, mattes drawn in the world from the Position, Normal and Depth passes, a depth fog and a light added after the render.
lightCompositing ProNuke's Glow and LightWrap, an exponential glow, an anamorphic streak, a glow around a matte.
grainCompositing ProNuke's Grain, with the Kodak stocks of its presets, and Regrain.
grade, merge, mask2dthe add-on, freeNuke's Grade and Merge operations, saturation, exposure, and 2D masks.

The graphs read the passes of the Render Layers node, so the scene must render them. In the View Layer properties, with Cycles as the render engine, turn on: Z, Normal and Position under Data; Direct, Indirect and Color of Diffuse, Glossy and Transmission, Emission and Environment under Light. A pass that is off is an output the node does not have, and the step stops with an error that names it.

Every block below is a complete .bn file, its code beside the nodes it builds. Two ways to try a step:

Render with F12 to see it. The pictures are made from these exact files by render.py: it builds the scene, renders it once with its passes to a multilayer EXR, then runs each step on that file. Cycles denoises the Combined pass only; render.py denoises the light passes too, one Denoise node each, before it writes them. Do the same, or render with more samples, or the rebuilt beauty will be noisier than the render.

From a render to a shot

A render is one image: once the light is baked into the pixels, you can only push their colours around. Cycles can also write how it made that image, as passes:

The light passes add up to the render. Keep them apart a little longer and each one is a handle: a colour, a light, a reflection you can change alone. The data passes tell you where things are in the scene, so a matte follows an object rather than a region of the frame. The compositor's job is then the one the render cannot do cheaply: add the air, the lens, the film and the look.

1. The render as it is

The smallest compositor there is: the image of the Render Layers node, the Combined pass, straight to the output.

step1_plate.bn: final_shot

RenderLayers() reads the scene being rendered. .image picks one of its outputs; the next steps read the others by name: l.diffuse_direct, l.depth, l.position…

A square at dusk: a terracotta sphere, a pillar, crates, a steel ring and a lamp post in front of dark buildings and a blue sky
Step 1. A correct render, and a flat one: the buildings look cut out of card and pasted on the sky, the lamps are hard white dots, the ground is a plain grey.

2. The beauty rebuilt from its passes

rebuild_beauty adds the passes up the way Cycles did: for diffuse, glossy and transmission, (direct + indirect) × color, then emission and the sky (environment). With nothing changed, its result is the image of step 1. So we change one thing on the way: the colour of the sphere.

step2_passes.bn: final_shot

The same shot with the sphere blue, lit and shaded exactly as before
Step 2. The sphere is blue; its light, its shadow and its highlight are those of the render.

Try: set glossy_direct to l.glossy_direct * 3.0: the reflections of the sun and the sky get stronger, on the ring and the paving, and nothing else changes.

3. A light added after the render

The lamp post should light the square, and in the render it barely does. A new render would take minutes. relight adds a point light now, from the passes: at each pixel, the surface's colour, times the light's colour, times how much the surface faces the light (the Normal pass), divided by the square of its distance (the Position pass).

step3_relight.bn: final_shot

The same shot with warm light on the crates, the pillar, the sphere and the paving around the lamp post
Step 3. A warm pool of light around the lamp post: on the crates, the side of the sphere, the pillar and the paving.

4. A haze from the depth

Far things look paler and take the colour of the air. Without that, the buildings 240 m away look as near as the crates. depth_fog blends the image toward a colour by 1 − exp(−density × distance), the distance read from the Depth pass.

step4_fog.bn: final_shot

The same shot with the buildings lighter and warmer, sunk into the evening air
Step 4. The buildings recede: lighter, warmer, less contrasted. The square in front has not changed.

5. Glow and light wrap

A lens is not perfect: a strong light spreads around itself, and a bright sky bleeds over the edges of what stands in front of it. A render has neither, and it shows. Two effects of light bring them back.

step5_glow.bn: final_shot

The same shot with soft halos around the lamps and a light rim along the edges of the buildings against the sky
Step 5. Halos around the lamps, and the sky's light on the edges of the buildings and the pillar.

Try: set the last input of light_wrap, its intensity, to 6.0, and watch the edges of the buildings. Then set the width of glow, its fourth number, to 8.0.

6. Film grain

A render is clean to the pixel, and next to filmed images that cleanness reads as CG. Grain hides it, and it holds the image together: every part of the frame shares the same texture.

step6_grain.bn: final_shot

To match the grain of a filmed plate rather than a stock, regrain(clean, plate) takes the grain from the plate itself: its fine detail, added to the clean image.

The same shot with a fine film grain over the whole frame, most visible in the sky
Step 6. Grain over the whole frame, strongest in the bright sky, little in the dark ground, as on film.

7. The look

Last, the grade: the mood of the shot. Everything here comes with the add-on, free: grade, mask2d, merge. The new lines go between the glow and the grain, because the grain must come last: it is on the film, and a grade after it would change it.

step7_look.bn: final_shot

  1. grade, Nuke's Grade: blackpoint takes the darkest values to black, lift puts a little blue into the shadows, gain warms the highlights, gamma below 1 darkens the mid-tones. Dusk: cool shadows, warm lights.
  2. saturation 1.15: a little more colour, after the grade has dulled it.
  3. Darker corners. circle_mask is 1 in a disc at the centre, falling off over 0.9; corners is its opposite. exposure_stops takes one stop off, through that mask only: the eye goes to the middle.
The finished shot: a darker, cooler square, warm lamps glowing, the blue sphere and orange crates, a warm horizon and darker corners
Step 7, the finished shot. Compare with step 1: the same render.

Try: set gamma to (1.1, 1.1, 1.1) for a lighter evening, or gain to (0.9, 1.0, 1.15) for a cold one.

The knobs

Each step adds a few inputs to turn. The ones that change the shot most:

WhereInputWhat it does
p_mattecenter, radius, falloffThe ball of the world the matte holds, in metres, and how softly it ends.
relightlight_position, light_color, intensityWhere the added light is, its colour and its strength.
depth_fogcolor, near, far, densityThe colour of the air, where the haze starts and stops, how fast it thickens.
light_wrapdiffuse, intensityHow far the background bleeds in from the edges, and how much.
glowtolerance, brightness, widthWhat is bright enough to glow, how strong the glow, how wide.
grain_5279amount, seed, animatedHow strong the grain, which grain, and whether it moves.
gradelift, gain, gammaThe colour of the shadows, of the highlights, and the weight of the mid-tones.

To finish your own render, enable the passes listed above, and change what names the scene: the centre and radius of p_matte, the light_position of relight, the distances of the fog. The rest holds for any shot.

Take it to Blender

The finished compositor, in one file. Drag the card onto Blender and keep Import into the .blend: final_shot becomes the scene's compositor, if it has none yet. A click on the card downloads the file.

The steps before it, to start again from any of them:

The files, with the script that renders this page's pictures, are in examples/tutorials/final_shot/.