
ANR Depth Prep
Turns any depth map, AI or CG, into one clean, calibrated distance pass that the other ANR depth nodes read, with edges snapped to the plate and flicker removed.
- Utility
- Comp & Depth pack
- 3 inputs
- 34 controls
Overview
Depth maps arrive in many forms: near white or near black, 0 to 1 or metres, distance or 1/distance, soft at the edges, flickering from frame to frame. Depth Prep sorts that out once. It reads what the numbers mean (Depth Type, or Auto with its decision shown in Status), turns them into distance in scene units, and hands that on.
It is the hub of the ANR depth tools. Connect the plate to Source and any depth map to Depth; then connect this node to the Depth input of ANR Depth Matte, Depth Look or Depth Camera, or of ANR Normals Prep and Normals Light. Those nodes find it through the wire and read its lens, its Near and Far distances and its focus distance, with nothing typed.
Calibrate puts a relative AI map into real units: drag two points onto things whose distance you know and type the distances. Edge Snap pulls the soft edges of AI depth onto the plate's edges, which removes the halos in defocus and fog, and Deflicker steadies AI depth against the neighbouring frames.
Output can also show the depth as Nuke's 1/distance, a normalized pass, camera-space position or normals, or a false-colour heat map for checking. The Focus section reads the distance under a point and pastes a ready ZDefocus.
Inputs
- Sourceoptional
The plate. Edge Snap and Deflicker use it to see where edges and motion are; without it the depth is still converted, but Edge Snap is off.
- Depthrequired
Any depth map in its red channel (or the channel set by Depth Channel): ANR Depth and Normal Creator with Write To on RGB, ANR Scene Solver, other AI depth, or a CG render's depth shuffled into rgba.
- Motionoptional
Motion vectors in rgba (forward u v, backward u v), for example ANR AI Vector Tracker with Output on Motion Vectors. Deflicker then follows each pixel to where it moved on moving shots.
Output. With Output on Depth (the default), the distance in scene units in RGB: what the other ANR depth nodes want. The other Output choices are for checking or for other tools.
Quick start
- Connect the plate to Source and the depth map to Depth.
- From ANR Depth and Normal Creator: set its Write To to RGB (alpha passes through) and Output to Distance (metres), then set Depth Type here to Distance (Z).
- For any other map, press Detect and Lock and read Status: it says how it reads the depth and the distances this frame runs to. Pick Depth Type yourself if that is wrong.
- For relative AI depth, open Calibrate: drag Point 1 (and Point 2) in the viewer onto things whose distance you know, type Distance 1 (and Distance 2), and press Calibrate.
- Set Output to False Colour to check the depth by eye, then back to Depth.
- In Lens, type the shot's Focal Length and Horizontal Aperture if you know them; the downstream nodes use them.
- Connect this node to the Depth input of ANR Depth Matte, Depth Look or Depth Camera, with the plate on their Source.
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.
No control matches.
All controls
ANR Depth Prep34 controls
- StatusStatus
status What this node reads the depth as, and the distances it comes to.
- OutputMenu
dpOutput Depth: distance in scene units in rgb -- what the other ANR depth nodes want on their Depth input.
Normalised Depth: 0..1, near white, Near to Far.
Inverse Depth: 1/distance, Nuke's own depth.Z convention (ScanlineRender, ZDefocus 'far = 0').
Position: camera-space X, Y, Z (Nuke axes; Z is negative in front).
Normals: camera-space surface normals, -1..1, facing the camera is +Z.
False Colour: a heat map of the depth to check it by eye.
Input
- Invert Input DepthCheckbox
dpInvertInput Flip the incoming map before conversion and cleanup: Input Black + Input White - depth. For a 0..1 map this is 1 - depth. For other ranges set Input Black and Input White. This overrides the direction inferred by Auto / Detect and Lock. For metric Z versus 1/Z, choose the appropriate Depth Type instead.
- Depth TypeMenu
dpType What the numbers on the Depth input mean.
Auto: looks at the frame and says what it decided in Status.
Distance: real distances (ANR Scene Solver, CG Z-depth).
Inverse Distance: 1/Z (Nuke ScanlineRender depth.Z).
Relative, near bright (disparity): Depth Anything, MiDaS, most AI depth.
Relative, near dark: ANR Depth and Normals (Lotus), Marigold.
Relative, near bright (linear): grey depth maps from other apps.- Detect and LockButton
dpDetect Decide Depth Type from this frame and fix it, so it cannot change between frames. Also reads the input range from a raw, unnormalised map.
- Depth ChannelMenu
dpChannel Which channel of the Depth input holds the depth.
- Input BlackSlider
dpInLo Relative types: the raw value that means the Far end (near-bright maps) or the Near end (near-dark maps). 0 for a normalised map.
- Input WhiteSlider
dpInHi Relative types: the raw value at the other end. 1 for a normalised map.
- Distance Along RayCheckbox
dpRay Distance and Inverse types: the depth measures along each pixel's ray rather than straight down the lens axis. Most renders and the Scene Solver are straight down the axis (off).
Distances
- Near DistanceSlider
dpNear Relative types: the distance the nearest value means. Also the near end of Normalised Depth and False Colour. Calibrate sets it for you.
- Far DistanceSlider
dpFar Relative types: the distance the farthest value means. Also the far end of Normalised Depth and False Colour.
- Distance ScaleSlider
dpScale Distance and Inverse types: multiply into scene units (0.01 turns centimetres into metres). Calibrate sets it for you.
- Max DistanceSlider
dpMaxDist Nothing is farther than this: sky, empty background, infinity.
Calibrate
- Point 1Position
dpCalPoint1 Drag onto something whose distance you know (a person, a door, the ground at a known spot).
- Distance 1Slider
dpCalDist1 How far Point 1 is from the camera, in your units (metres, say).
- Point 2Position
dpCalPoint2 Drag onto something whose distance you know (a person, a door, the ground at a known spot).
- Distance 2Slider
dpCalDist2 How far Point 2 is. Leave 0 to calibrate from Point 1 alone (scale only).
- CalibrateButton
dpCalibrate Solve the distances so the two points read what you typed. Sets Near/Far (relative types) or Distance Scale (distance types).
Clean Up
- Edge SnapSlider
dpSnap Pull the depth's edges onto the plate's edges. AI depth is soft and a few pixels off at outlines, which is what makes halos in defocus and fog. Needs the plate on Source. Set it to 0 for a CG render's depth, which is already exact (at 0.7 it moves exact depth by 0.2% on average).
- Snap RadiusSlider
dpSnapRadius How far, in pixels, an edge may be pulled.
- Snap Colour MatchSlider
dpSnapEdge How alike two plate colours must be to count as the same surface. Lower splits on fainter edges (and on texture); higher only on strong ones.
- DeflickerSlider
dpFlicker Steady per-frame AI depth against its neighbours: the whole frame's level first, then patches. 0 is off. Wire vectors to Motion for moving shots.
- Deflicker FramesSlider
dpFlickerFrames Frames each side to compare against.
- Motion ToleranceSlider
dpFlickerSigma How different the plate may look at a pixel before a neighbouring frame stops counting there (it has moved). Lower is safer on moving shots.
Lens
- Focal LengthSlider
dpFocal Millimetres. Used for Position and Normals here, and read by the Look and Camera nodes. Copy it from a solved camera if you have one.
- Horizontal ApertureSlider
dpAperture Film back width in millimetres (36 = full frame, 24.9 = Super 35).
- Normals SmoothingSlider
dpNormalSmooth Pixels of smoothing on the Normals output. Depth maps are noisy in their slopes.
False Colour
- PaletteMenu
dpPalette Colours for Output = False Colour, near to far across Near/Far Distance.
- Contour EverySlider
dpContour Draw a line every this many units of distance. 0 is off.
- OpacitySlider
dpOverPlate False colour over the plate: 1 is solid colour.
Focus
- Focus PointPosition
dpFocusPoint Drag onto what should be sharp. Focus Distance reads the depth there.
- Focus DistanceSlider
dpFocusDist The distance at the Focus Point (set when you move it; type over it freely). Create ZDefocus puts it into the ZDefocus's focal plane.
- Create ZDefocusButton
dpMakeZDefocus Put a Copy (this node's depth into depth.Z on the plate) and a ZDefocus focused at Focus Distance on the clipboard. Ctrl+V in the Node Graph.
The pasted ZDefocus reads distance directly, so keep Output on Depth. If Status asks you to, paste with the plate selected and connect the Copy's A input to this node.
- Create depth.Z CopyButton
dpMakeDepthLayer Just the Copy: the plate with this node's distance in depth.Z, for any Nuke tool that reads a depth layer.
The Copy carries this node's distance (not 1/distance) into depth.Z, so keep Output on Depth.
Tips
- Set Edge Snap to 0 for CG depth, which is already exact; keep it for AI depth.
- For flickering per-frame AI depth, raise Deflicker toward 1. On moving shots, connect motion vectors to Motion, and lower Motion Tolerance if moving parts smear.
- Contour Every draws a line every so many units on the False Colour view, a quick way to check that distances grow evenly.
- Drag Focus Point onto what should be sharp: Focus Distance reads the depth there. Create ZDefocus then puts a Copy and a ZDefocus focused at that distance on the clipboard; press Ctrl+V in the Node Graph.
- ANR Depth Camera uses this node's Focus Distance as its default for Keep Size At and Convergence.
- The downstream nodes find this node by following their Depth input upstream, so a Reformat or a Grade in between is fine.
- A Nuke ScanlineRender writes 1/distance into depth.Z: Shuffle it into red and set Depth Type to Inverse Distance (1/Z).
Good to know
- The node runs no AI model and needs no graphics card.
- It reads only the red, green, blue and alpha channels of the Depth input, never a
depth.Zlayer directly. - A depth map more than about 10% smaller or larger than the plate is stretched over the plate (a low-resolution AI map); within that, it is laid pixel for pixel. Crop or Reformat a CG depth whose bounding box differs from the plate first.
- Relative AI depth is not in real units until you calibrate it. Fog density, occlusion radius, shadow length and camera moves downstream are all in this node's units.
- Deflicker reads several frames for each frame it renders, so it slows the node down.
Something unclear or missing? Write to [email protected].