ANR Tools

ANR Normals Prep

Turns any normal pass, AI or CG, packed or signed, camera or world space, into clean camera-space normals, or makes normals from a depth pass or the plate itself.

  • Utility
  • Comp & Depth pack
  • 4 inputs
  • 34 controls

Overview

Normal passes come in many forms: packed 0 to 1 or signed -1 to 1, camera or world space, Y up or down, Z up or Y up. Normals Prep reads the pass on its Normals input, says in Status how it read it, and hands on one form: Nuke camera space, X right, Y up, Z toward the camera, -1 to 1. That is what ANR Normals Matte and ANR Normals Light want.

Detect and Lock works out the encoding and which axes point the wrong way. A world-space CG pass is turned into camera space with the Camera you name in Camera Node, frame by frame, so an animated camera works.

The Clean Up section pulls soft AI normals onto the plate's edges, smooths their grain without crossing outlines and steadies flicker. Depth and Detail can take the large shapes from an ANR Depth Prep and the fine detail from the pass, or add fine relief read from the plate's own light and shade.

With Normals From set to Depth Input the node makes normals from a Depth Prep's distances, and with Plate Only from the picture alone. Output also offers checking views (a clay render, an orientation view), a curvature pass and a height map.

Inputs

SourceNormalsDepthMotionNormals PrepOutput
  1. Sourceoptional

    The plate. Edge Snap, Smooth and Plate Detail use it; without it those are off.

  2. Normalsoptional

    The normal pass to read: ANR Depth and Normal Creator with Output on its Normals choice and Write To on RGB, a CG render's N shuffled into rgb, or any normal map. Not needed with Normals From on Depth Input or Plate Only.

  3. Depthoptional

    An ANR Depth Prep (Output on Depth). Used for Normals From Depth Input, for Shape From Depth, and by Detect and Lock to check every axis, X included. Its lens is read through the wire.

  4. Motionoptional

    Motion vectors in rgba (forward u v, backward u v), for example ANR AI Vector Tracker with Output on Motion Vectors, so Deflicker follows moving pixels.

Output. With Output on Normals (the default), camera-space normals in RGB, -1 to 1. Other choices give them packed 0 to 1, in world space, or as a clay render, orientation view, curvature, height map or the plate's detail alone.

Quick start

  1. Connect the plate to Source and the normal pass to Normals. For better axis detection, also connect an ANR Depth Prep to Depth.
  2. Press Detect and Lock and read Status: it says the encoding it found and any axes it flipped.
  3. Set Output to Clay to check the normals by eye: the grey render should look like the plate's shapes lit from the front left (Clay Light Azimuth and Clay Light Elevation move that light).
  4. For a world-space CG pass, set Space to World Space and type the name of the render Camera into Camera Node.
  5. For AI normals, keep Edge Snap and raise Smooth a little if they look grainy; set Edge Snap to 0 for a CG pass.
  6. Set Output back to Normals and connect the node to the Normals input of ANR Normals Matte or ANR Normals Light.

The panel

The node's panel as Nuke shows it, with the values of a new node. Click any control to see what it does; tabs and sections work as in Nuke.

ANR_Normals_Prep1
StatusConnect a normal pass to the Normals input and the plate to Source, then press Detect and Lock.
OutputNormals
Normals FromNormals Input
EncodingAuto
Detect and Lock
Flip X
Flip Y (DirectX)
Flip Z
Z Is Up
SpaceCamera Space
Camera Node
Camera Rotatex0y0z0
Edge Snap0.7
Snap Radius10
Snap Colour Match0.1
Smooth0
Deflicker0
Deflicker Frames2
Motion Tolerance0.08
Shape From Depth0
Shape Size24
Plate Detail0
Detail Size4
Detail Strength5
Dark Is Raised
LensFrom Depth Prep
Focal Length35
Horizontal Aperture36
Clay Light Azimuth-45
Clay Light Elevation35
Curvature Size4
Curvature Gain1
Height Quality40
Height Scale1

All controls

ANR Normals Prep34 controls
StatusStatusstatus

What this node reads the pass as.

OutputMenunpOutput

Normals: camera space, -1..1 (X right, Y up, Z toward the camera) -- what Normals Matte and Normals Light want.
Normals (packed 0-1): the same as colours, for other apps.
World Normals: rotated by the Camera into world space.
Clay: a grey render lit from Preview Light, to check the normals by eye.
Orientation: sideways red, facing up green, facing the camera blue.
Curvature: grey 0.5, brighter on edges and bumps, darker in creases.
Height: the normals integrated into a relief map (displacement).
Plate Detail: only the fine relief read from the plate.

Default: NormalsOptions: Normals Normals (packed 0-1) World Normals Clay Orientation Curvature Height Plate Detail

Normals FromMenunpFrom

Normals Input: a normal pass. Depth Input: made from an ANR Depth Prep's distances (smooth, no fine detail). Plate Only: fine relief from the picture alone.

Default: Normals InputOptions: Normals Input Depth Input Plate Only

Input

EncodingMenunpEncoding

Packed passes store (n + 1) / 2 so they fit an 8-bit image; most CG passes are signed.

Default: AutoOptions: Auto Signed (-1 to 1) Packed (0 to 1)

Detect and LockButtonnpDetect

Decide Encoding from this frame and, for a camera-space pass, which axes point the wrong way: visible surfaces face the camera, the bottom of frame is usually ground facing up.

Flip XCheckboxnpFlipX

Red points left instead of right.

Default: off

Flip Y (DirectX)CheckboxnpFlipY

Green points down instead of up: DirectX-style normal maps.

Default: off

Flip ZCheckboxnpFlipZ

Blue points away from the camera.

Default: off

Z Is UpCheckboxnpZUp

A world-space pass from a Z-up app (Blender, 3ds Max): turned to Nuke's Y up.

Default: off

SpaceMenunpSpace

Camera Space: the pass moves with the camera (AI normals, most 'N camera' AOVs). World Space: a CG render's N; it is turned into camera space with the Camera below.

Default: Camera SpaceOptions: Camera Space World Space

Camera NodeTextnpCamera

World Space: the name of the Nuke Camera that rendered the pass (e.g. Camera1). Its rotation is read on every frame, so an animated camera works.

Default: empty

Camera RotateXYZnpCamRotate

World Space with no Camera node: the camera's rotation in degrees (X tilt, Y pan, Z roll, Nuke's ZXY order). Animatable.

Default: 0 0 0

Clean Up

Edge SnapSlidernpSnap

Pull the normals' edges onto the plate's edges. AI normals are soft and a little off at outlines. Set 0 for a CG pass, which is already exact.

Default: 0.7

Snap RadiusSlidernpSnapRadius

How far, in pixels, an edge may move.

Default: 10

Snap Colour MatchSlidernpSnapColour

How alike two plate colours must be to count as the same surface.

Default: 0.1

SmoothSlidernpSmooth

Edge-aware smoothing, in pixels: calms the grain of AI normals without crossing outlines.

Default: 0

DeflickerSlidernpFlicker

Steady per-frame AI normals against their neighbours. 0 is off. Wire vectors to Motion for moving shots.

Default: 0

Deflicker FramesSlidernpFlickerFrames

Frames each side.

Default: 2

Motion ToleranceSlidernpFlickerSigma

How different the plate may look before a neighbouring frame stops counting at a pixel.

Default: 0.08

Depth and Detail

Shape From DepthSlidernpFuse

With an ANR Depth Prep on the Depth input: take the large shapes from the depth and the fine detail from the pass. 1 is all shape from depth.

Default: 0

Shape SizeSlidernpFuseSize

Pixels: bigger than this is 'shape', smaller is 'detail'.

Default: 24

Plate DetailSlidernpDetail

Add fine relief read from the plate's own light and shade (like CrazyBump): skin, bark, fabric, brickwork.

Default: 0

Detail SizeSlidernpDetailSize

The size of the relief, in pixels.

Default: 4

Detail StrengthSlidernpDetailStrength

How steep the relief is.

Default: 5

Dark Is RaisedCheckboxnpDetailInvert

Read dark as high instead of bright (cracks and pores are dark).

Default: off

LensMenunpLensFrom

For normals from depth: the Depth Prep's focal length, or the two below.

Default: From Depth PrepOptions: From Depth Prep Custom

Focal LengthSlidernpFocal

Custom lens, mm.

Default: 35

Horizontal ApertureSlidernpAperture

Custom film back, mm.

Default: 36

Views

Clay Light AzimuthSlidernpPreviewAzimuth

Clay: 0 from the camera, 90 from the right.

Default: -45

Clay Light ElevationSlidernpPreviewElevation

Clay: 90 from above.

Default: 35

Curvature SizeSlidernpCurvScale

Pixels: the size of edge the curvature looks for.

Default: 4

Curvature GainSlidernpCurvGain

Contrast of the curvature output.

Default: 1

Height QualitySlidernpHeightQuality

Solver passes per level. More is closer to the true relief, slower.

Default: 40

Height ScaleSlidernpHeightScale

Height is in frame widths times this.

Default: 1

Tips

  • Normals from ANR Depth and Normal Creator are already signed and in Nuke's camera space: Encoding Signed (-1 to 1), Space Camera Space, no flips.
  • Without a Depth input, Detect and Lock can settle Y and Z but not X. Check that walls on the left of frame key as facing right in ANR Normals Matte, or connect a Depth Prep and press Detect and Lock again.
  • Output > Orientation shows sideways surfaces red, upward ones green and those facing the camera blue: a quick check that floors read as up.
  • Shape From Depth with a Depth Prep keeps the pass's fine detail but takes the large, often wobbly, shape from the depth; Shape Size sets where shape ends and detail begins.
  • Plate Detail adds fine relief such as skin, bark, fabric or brickwork from the plate's light and shade; turn on Dark Is Raised when cracks and pores are dark.
  • For flickering per-frame AI normals, raise Deflicker, and connect motion vectors to Motion on moving shots.

Good to know

  • The node runs no AI model and needs no graphics card.
  • World Normals output only differs from Normals when Space is World Space, turned with the Camera in Camera Node or with Camera Rotate.
  • Height treats the frame as seen head-on: good for relief on surfaces facing the camera, not a depth map. A floor seen edge-on comes out as a cliff.
  • Deflicker and Shape From Depth work on the Normals input only, not with Normals From on Depth Input or Plate Only.

Something unclear or missing? Write to [email protected].