Week 14 – Adjusting Multipass and Relighting

Importing 3D Files and Texture Replacement:

  • Utilize the ReadGeo node to import 3D model files in formats such as fbx or abc.
  • Replace textures in Nuke using the STMap node. Create an STMap using UV expressions, connecting the source and the STMap to dynamically alter the texture based on the STMap.

Workflow for Adjusting Multipass Images:

  • When working with multipass images, it’s crucial to unpremult all channels (set knob ‘divide’ to ‘all’, default: RGB).
  • Subtract the AOV you want to adjust using the Merge node with the ‘from(B-A)’ operation.
  • Perform color grading on the pass and merge it again.
  • Remove all channels except RGBA using the Remove node to avoid unnecessary calculations.
  • Finally, premultiply it again.

Relighting

Position Pass:

  • Represents the 3D scene in color values (Red: x-coordinate, Green: y-coordinate, Blue: z-coordinate).
  • Utilize the PositionToPoints node to visualize it in 3D space.
  • Depth channel stores the distance from a point in 3D to the camera’s position.

Relighting Setup v01
Relighting Setup v02

Relighting Setup v01/02:

  • Use the PositionToPoints node to generate a 3D preview of the geometry in the rendered image.
  • Connect incoming diffuse, normals, and camera data into the ReLight node.
  • Add a material to control how the geometry reacts to new lighting.
  • Add lights grouped into a Scene node visible to both the 3D preview and the final image.
  • Merge the result over the existing plate.

Relighting Setup v03

Relighting Setup v03:

  • Similar to the normal process, unpremult all passes, and apply the PP_Mask_hub Gizmo with the Position pass.
  • Create alpha from a picked color on the viewer, set the alpha, connect to Grade node for its mask, and then premultiply all passes again.

Relighting Setup v04

Relighting Setup v04:

  • Follows the same overall process as v03 but uses the W_SuperNormal Gizmo with the Normal pass.
  • Pick a color on the viewer, move the position of light horizontally and vertically.

Tips:

  • Relative Path:
    • Use relative paths in Project settings to target directories easily. Find it in Project settings -> Root -> Project directory -> Script Directory.
    • Copy and paste the directory before your folder directory, typically ‘[python {nuke.script_directory()}]/’.
    • Essential for collaborative work or moving to different computers to streamline relinking.
  • Create Custom Node:
    • Share your custom nodes easily by copying and pasting from Nuke to Notepad (create) or copying text and pasting in Nuke (apply).