Home · Lab · Integration

I2 Haze by depth

Haze is a coloured layer masked by depth, not a lift

Integration · ~7 min · Free

1 The idea

The depth pass here is normalised: 0 near, 1 far. Use it as the alpha of a haze-coloured layer and lay it over the plate: far things get a lot of haze, near things almost none.

A lift over the whole frame raises near and far equally, which looks like flare, not air. View the nodes one by one to see the difference.

haze = Constant(colour) · depth → over plate

2 Hands-on in the mini compositor

Task: disable the lift Grade and enable the haze Merge

Click "Read depth" to look at the depth pass

SkyVFX mini compositor · I2640×360 · float · 1001

3 Deep dive

Haze is a coloured layer, not a lift

Real air does two things at once: it lifts the blacks and pulls the highlights down. Distant things get both paler and flatter, and they take on the colour of the air. A Grade lift is different: it pivots at 1, so it raises darks and mids and pulls values above 1 down (lift 0.1 takes 4.5 to 4.15, see I1), but by the same amount at every depth and with no air colour.

A closer model is a layer of haze colour (a Constant) laid over the image through a depth mask. The result is image × (1 − m) + haze × m: the larger m is, the more the original fades and the haze colour takes over.

Lift that grows with depth = atmosphere. Equal lift near and far = flare.

Normalise depth to 0–1 first

Raw depth from Blender is real distance and can be in the hundreds or thousands, so it can’t be used as a mask as is. Remap it so near = 0 and far = 1, with a Grade: blackpoint = the nearest value, whitepoint = the farthest.

Check which depth you have first. Some renders give real distance (near = small), some give 1/Z (near = large), and empty sky pixels can hold a huge value or 0. Read the real values in the viewer before you set the Grade.

  1. 1Shuffle depth → alpha
  2. 2Grade: near 0, far 1
  3. 3Second Grade: shape it
  4. 4Haze colour Constant
  5. 5Merge through the mask

Shape the haze and pick its colour

A second Grade on the mask sets where the haze starts (blackpoint) and where it is thickest (whitepoint); gamma sets how gently it builds. Haze must always grow with distance.

Sample the haze colour from a neutral far area of the plate, such as the hills at the horizon. Another option is to use a heavily blurred plate as the colour source, so the haze follows the plate when its light changes.

At normal exposure the haze should be barely visible. Push the viewer gain up to check that it really grows with depth.

Grade order for the scene

Haze eats contrast. Contrast added before the haze gets washed out by it, so the order is: balance first, add small highlight pings, add haze, then bring contrast back, and keep the creative grade for last. This is the order for the whole merged scene (a full-CG environment, say, or the final look of plate plus CG). Each element’s own chain from I1 is finished before this point; after the re-contrast and the creative grade, re-check the blacks with the viewer gamma up.

  1. 1Balance
  2. 2Highlight pings
  3. 3Haze
  4. 4Re-contrast
  5. 5Creative

Every time you change the haze, re-check highlights, shadows and contrast.

4 In real work

In Nuke

  1. Shuffle: move the CG depth into alpha.
  2. Grade on alpha: blackpoint = nearest, whitepoint = farthest, giving a mask that is 0 near and 1 far.
  3. Second Grade on the mask: where haze starts, where it is thickest, and the gamma of the fall-off.
  4. Constant in a haze colour sampled from the far plate → Merge (over) onto the unpremultiplied CG through the depth mask (or Keymix), then Copy the original CG alpha back. In I1’s chain this sits after the Toe and before the Premult. With haze on the CG, match the Toe to a haze-free black (the near zone’s) and let the haze add the far lift; a Toe matched to the far zone plus haze lifts far CG twice.
  5. If depth edges don’t line up with the image edges and leave dark lines, Erode or Blur the mask slightly.

Common mistakes → the fix

  • ✗ Making haze with a Grade lift only✓ Lay a haze-colour Constant through the depth mask: it lifts blacks, lowers highlights and adds colour, more with distance.
  • ✗ Using raw depth as the mask without normalising it✓ Always remap it to near 0, far 1 first.
  • ✗ An inverted mask, so the haze is thickest on the nearby robot✓ Check that near is black and far is white; if the render gives 1/Z, invert it first.
  • ✗ Adding contrast before the haze✓ Add haze first, then bring contrast back.

Before you send the shot

  • Haze grows with depth; it is not equal near and far.
  • The depth mask is 0 near and 1 far.
  • The haze colour comes from the plate, not a guess.
  • CG blacks are not brighter than the sky or the far hills.
  • No dark lines along the CG edges after the haze.

5 Check yourself

One question to check yourself

An equal lift near and far looks like…

What you learned

🔒 Answer the question above and this card opens

More questions

1. With the viewer gain up, the CG blacks are lifted by the same amount near and far. How does that read?

2. Why does a Constant through a mask look more real than a Grade lift for haze?

Where the numbers come from: Computed in your browser. Saturation, Multiply, Clamp, Invert, Keymix, Copy and Grade match Nuke 17.0v2 (checked). Blur, Defocus, Glow, Sharpen, ChromaticAberration, Vignette, LensDistort, Grain, Erode, Toe, the Keyer and Despill are teaching versions, not identical to Nuke’s nodes. Transform here is also a teaching version: bilinear filtering, no concatenation, cropped at the frame edge. Images are our own Blender renders (the green screen is fully code-built; the desert scene uses Gaea 2.3 hills, a Poly Haven CC0 HDRI sky, Poly Haven CC0 rocks and grass, Quixel sand and cliff textures and a Mixamo rig for the robot, with Quixel and Mixamo used in the renders only).