CompStart

ProLessonsCoursesElementsSoftware

CompStart

Master visual effects with cutting-edge techniques.

Learning

CoursesLessonsPro FeaturesAssetsSoftware

Tools

Tech CheckDisplay CheckMotion BlurCIE 1931PhysLight

Company

InstructorMissionImpressumPrivacyTerms

Projects

Moray RenderEXR ConverterOCIO.ccNuke ToolsDerekVFX

Follow

YouTubeInstagramTikTokThreadsContact

© 2026 CompStart. All rights reserved.

Node Graph Structure

June 19, 2024

vfx
structure
vfx
nuke

A Nuke script is a directed acyclic graph (DAG): nodes (vertices) connected by pipes (edges) that always flow forward — never in a cycle. That is not just computer science trivia. It is why your script can be evaluated in a clear order, cached, and handed to another artist without turning into a knot.

In mathematics, particularly graph theory, and computer science, a directed acyclic graph (DAG) is a directed graph with no directed cycles… following those directions will never form a closed loop… A directed graph is a DAG if and only if it can be topologically ordered…— Wikipedia: Directed acyclic graph

Good graph structure is how you stay fast, debuggable, and employable on a team. This lesson is the convention set most feature comps expect you to follow.


1. Build a clear B-spine

Every serious composite should have a distinct B-spine: a vertical column of Merge nodes stacked so the main stack travels through the B input. Your footage if it exists should be vertically aligned above your final shot write node.

Why B, not A

  • By default, Merge takes metadata from the B side (resolution, channels, often the “hero” pipe you want to preserve).
  • The spine is the continuous plate / beauty stack. Elements come in on A and land onto that stack.
  • Reading top-to-bottom (or bottom-to-top, if that is show convention), another artist can follow the shot story without hunting sideways spaghetti.

Rule of thumb: if you cannot point at one vertical run of Merges and say “that is the shot,” the graph is not structured yet.


2. Follow lens logic

Lens logic means: stack layers in the order a real camera / lens would see them — front to back in depth, not in random paint order.

Light hits the sensor after passing through whatever is in front. In the composite:

  • Foreground sits over midground sits over background.
  • You should not need heroic holdouts for things that are simply behind something already in the stack.
  • The result should feel like one photograph, not a collage of cards.

Practical signs you broke lens logic

Smell

What it usually means

Lots of unnecessary holdouts

Layers are in the wrong depth order

Merge set to under a lot

You are forcing A behind B because the stack is inverted

Stenciling one layer by another just to “put it behind”

Reverse lens logic — reorder the stack instead

Foreground edge work on something that should be occluded

Wrong merge order

If you find yourself setting Merge to “under,” stop and fix the order. Under is a tool, not a lifestyle. Chronic under-merges mean the B-spine is upside down relative to depth.

Save holdouts for real problems

Foreground elements already hold out what is behind them when the stack order is correct. Use explicit holdouts when:

  • CG / cards interpenetrate or share depth
  • You need contact shadows / dual beauty integration
  • Partial transparency requires a true holdout pass

Not because the graph was built back-to-front.


3. Keep it simple

A complex graph is not a badge of skill. It is a liability.

  • Harder to troubleshoot (many hidden dependencies)
  • Easier to introduce bugs (double grades, forgotten branches, dead pipes)
  • Slower for review and handoff
  • More fragile under retakes and note versions

Prefer:

  • One clear spine
  • Short side branches that rejoin the spine
  • Deleted dead nodes (or a clearly labeled DOT / sticky for “parked” experiments)
  • Groups / backdrops only when they reduce noise, not when they hide chaos

If two nodes do the same job, one of them should go. If a chain can be one Grade instead of five, use one Grade.


4. Use channels (DRY)

“Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.”— DRY: Don’t Repeat Yourself

In a node graph, DRY means:

  • Do not rebuild the same matte five times on five branches.
  • Derivatives of a layer live together — beauty, ID, crypto, motion vectors, depth for that element in one region of the graph.
  • Prefer shuffling / channel management over duplicating full RGB trees that diverge and rot.

Channel habits that pay off

  • Keep utility passes (depth, P, N, vectors, IDs) on the same pipe as the beauty when practical, or on a labeled parallel pipe that stays aligned.
  • One authoritative key → multiple consumers (merge mask, grade mask, grain mask), not five re-keys.
  • When you fix the key once, every dependent op updates.

Repeating work is how versions drift: “I fixed the despill on the beauty but not on the contact shadow branch.”


5. Flow left to right

By convention, sources and side work flow left → right into the vertical spine.

  • Renders enter from the left
  • Nodes to modify inputs placed vertically
  • They make a right angle on an elbow and head left to right into a B-spine merge
  • Output continues down, repeat

Why it matters

  • Matches how most artists already scan a desk
  • Nuke’s mask input on Merge sits on the right — horizontal prep into a vertical stack reads naturally
  • Reviewers can “read” the script like a comic panel: left = ingredients, center/spine = recipe, bottom = plate

Consistency beats personal flair. Match the show’s template if one exists.


6. Structure for teamwork

You are not the only person who will open this script. Supervisors, TDs, lighting, the night crew, and future-you in six months all need to understand it.

Treat the graph like readable code:

Practice

Why

Clear backdrops / sections

“Prep,” “Key,” “CG integrate,” “Grain,” “Out”

Sticky notes for non-obvious intent

“Client note v03 — keep edge warm”

No mystery disconnected islands

Delete or label parked work

Same merge / lens conventions as the team

Hand-off without a guided tour

A clean graph:

  • Communicates workflow and intent
  • Reduces mistakes under time pressure
  • Makes notes and retakes cheaper
  • Signals professionalism — people notice

Inspiration / gallery of extreme (and educational) scripts: scriptsofanotherdimension.tumblr.com

Study them for layout ideas — then simplify for production.


Mental model (one page)

  1. B-spine = hero stack, vertical Merges on B
  2. Lens logic = front over back; avoid chronic under
  3. Simple = fewer nodes, obvious path
  4. Channels / DRY = one source of truth per idea
  5. Left → right into the spine
  6. Labels so humans can read it
  7. Keep lensing at the bottom

Anti-patterns (fix these)

Anti-pattern

Fix

Spaghetti with no main pipe

Rebuild a B-spine; branch and rejoin

Everything merged under

Reorder depth; use over with correct B

Horizontal “novel” of Merges

Vertical spine + left-side prep

Viewer LUT baked into Write

Keep color management out of “creative mess” mid-graph


Quick checklist before handoff

  • CheckedOne obvious B-spine of Merges
  • CheckedLayers ordered by lens / depth logic (minimal unnecessary holdouts)
  • CheckedAlmost no chronic Merge under used as a crutch
  • CheckedLeft → right prep into the spine
  • CheckedNo duplicated keys/grades that should be one pipe
  • CheckedChannels / utilities grouped with their layer
  • CheckedNamed nodes + backdrops a stranger can scan in 30 seconds
  • CheckedDead nodes removed or clearly parked

Summary

  • A Nuke script is a DAG — keep the data flow obvious and acyclic in intent, not only in topology.
  • Build a B-spine: vertical Merges, hero stack on B, elements on A.
  • Lens logic: front over back; if you live on under, your order is wrong.
  • Keep it simple so retakes and debugging stay cheap.
  • DRY / channels: one authoritative representation of each matte and pass.
  • Left to right into the spine; label everything for the team.

Structure is not bureaucracy. It is how your shot survives contact with other humans and future notes.

PreviousNuke DefaultsNextLensing