top of page
War for the Planet of the Apes

Lesson 3 : Nuke for Advanced Users

This lesson 3 focuses on more complex techniques used in compositing in Nuke, such as deep compositing, projections onto cards, Nuke scripting, and some tips.

Table of Contents
 

1. Deep compositing 
2. 3D projection
3. Scripting

4. Tips

5. Sources

1. Deep compositing 

Deep compositing, as a technique, wasn't invented by a single person or company but emerged as an innovation in the visual effects (VFX) industry through contributions from various professionals and VFX studios. However, one of the main players in popularizing and perfecting this technique is Weta Digital, a visual effects studio based in New Zealand.

Deep compositing is an advanced technique used in the VFX and animation industry to combine multiple layers of images or video sequences into a single final image. Unlike traditional compositing, where each layer is typically a 2D image with color and transparency information, deep compositing uses more complex 3D data, including depth information for each pixel.

weta digital
weta digital

Avatar 2, 2022

Principles of Deep Compositing


Depth Data:
In deep compositing, each pixel of an image contains not only color and transparency (alpha) information but also depth information, which indicates the distance of that pixel from the camera. This allows for better management of interactions between different elements, especially occlusions (where one object hides another).

 

Multiple Samples Per Pixel:
Instead of having a single value per pixel, deep compositing often records multiple samples per pixel, each with its own color, alpha, and depth data. This provides increased accuracy in blending and processing layers, particularly in complex scenes with transparent or semi-transparent elements.

 

Flexible Manipulation and Adjustments:
Thanks to depth data and multiple samples, artists can more easily adjust the relative position of elements in post-production, change the order of elements, or adjust effects like blur, lighting, and other visual effects without re-rendering the entire scene.

 

Advantages


Increased Precision:

The ability to work with depth data allows for more precise compositing, especially in scenes where objects overlap or are partially transparent.

 


Flexibility in Post-Production:
Artists have more control to adjust elements after the initial render, which can save time and resources.

 


Better Integration of Elements:
Allows for more natural integration of CG (Computer Graphics) elements into live-action or virtual scenes.
Disadvantages

 


Complexity and Cost:
Deep compositing generates much larger files than traditional techniques, requiring more storage and greater computational resources for processing.

 


Learning Curve:
Handling deep data and integrating it into post-production workflows requires advanced skills and technical knowledge.
Deep compositing is therefore a powerful technology that significantly enhances the quality and flexibility of work in VFX and animation, although it demands specific resources and expertise.

Deep nodes :

deep compositing nuke

Weta has made several videos explaining the workflow used in the studio with this technology.

2. 3D projection

3D projection in Nuke is a powerful technique used to map 2D images onto 3D geometry, which can then be viewed from different angles using an animated camera. This method is commonly used to create matte paintings, set extensions, and complex visual effects shots. Here’s a step-by-step guide to setting up 3D projection in Nuke using an Alembic export of an animated camera and a card.

camera maya
camera maya

I animated a camera from frame 0 with a translate (x) value of 0.00 to frame 50 with a translate (x) value of -12.650. Now we are going to export it as an Alembic file so that Nuke can read it.

camera maya

By clicking on the small empty square, you can choose your parameters. Make sure to set the start and end frames and enter your frame range because the default setting is the current frame.

export maya

For the matte painting we want to project, it will be a simple sky image. Make sure to drag the Alembic file into your Node Graph to automatically generate a camera. We will duplicate it and delete the animation keys on one of them to have a reference origin during the projection.

ciel nuage

Sky projection

3d nuke camera
3d nuke camera

Set up projection

Camera No Animation and Animation

You can visit the Foundry documentation to discover the utility of each node used: https://learn.foundry.com/nuke/content/reference_guide/3d_nodes/project3d.html

The Project3D node in Nuke is a powerful tool used for projecting a 2D image onto 3D geometry. This technique is often used in matte painting, set extensions, and other visual effects tasks where a 2D image needs to be seamlessly integrated into a 3D scene.

The Scene node in Nuke is a fundamental component used for combining multiple 3D elements into a single 3D scene. It manages and organizes the 3D objects, cameras, lights, and other scene elements, providing a way to create and control complex 3D environments.

The ScanlineRender node in Nuke is used to render 3D scenes into 2D images. It transforms the 3D elements in your node graph, such as geometry, cameras, lights, and projections, into a 2D composite that can be viewed and further processed.

Additional Tips

Optimize: Use proxy settings and lower resolution during the setup phase for better interactivity.

Fine-tune: Adjust the position and orientation of the card and projection settings to ensure the projection aligns correctly with the 3D space.

Depth of Field and Motion Blur: Utilize these features in the ScanlineRender node to add realism.

ciel nuage

Result, the sky match with the camera mouvement.

3. Scripting

Scripting in Nuke is a powerful way to automate tasks, create custom tools, and streamline workflows. It allows users to enhance Nuke's functionality beyond its standard graphical interface. Here are key aspects of scripting in Nuke:

Languages Used

Python: The primary scripting language in Nuke. It’s widely used for automating repetitive tasks, manipulating node graphs, creating custom nodes, and more.


TCL: Used for simple expressions and script-based expressions within nodes.
Applications of Scripting


1. Automation:

Batch Processing: Automate repetitive tasks like batch rendering, setting up render passes, or applying the same set of operations to multiple shots.

Pipeline Integration: Integrate Nuke with other tools and software in your VFX pipeline, such as asset management systems or render farm software.


2. Custom Tools:

Custom Nodes and Gizmos: Create new nodes or gizmos with specific functionalities tailored to your project needs.
User Interfaces: Develop custom user interfaces to simplify complex tasks or create custom control panels for specific workflows.


3. Node Graph Manipulation:

Node Creation and Modification: Automatically create, connect, and modify nodes within a script to set up complex node graphs quickly.

Parameter Control: Adjust parameters of multiple nodes simultaneously or based on certain conditions.


4. File Management:

Automated Import/Export: Script the import and export of assets, sequences, or entire projects.

Version Control: Manage different versions of scripts, comps, and assets programmatically.
Examples of Scripting in Nuke

script nuke
script nuke

Script Editor Nuke

Examples of Scripting in Nuke

1. Creating Nodes:

nuke compositing

2. Batch Rendering:

deep compositing nuke

3 Custom Gizmo:

nuke compositing

Best Practices :

Comment Your Code: Write clear comments to explain what each part of your script does.

Modular Code: Break your scripts into smaller functions or modules for better readability and reusability.

Error Handling: Implement error handling to manage unexpected issues gracefully.

Version Control: Use version control systems like Git to manage changes and collaborate with other developers.

By leveraging scripting in Nuke, artists and technical directors can significantly enhance their productivity, create custom solutions tailored to their specific needs, and streamline complex workflows.





You will find comprehensive courses in the scripting section of the Render Factory. There, you will find lessons on different software like Maya, Houdini, and Nuke.

4. Tips

Proxy Mode

 

Use Proxy Mode to work more efficiently on heavy sequences.

 

 

Disk Cache

 

Utilize the Disk Cache node to pre-render parts of your composite and enhance playback performance.

 

 

 

 

 

 

 

 

 

 

 

 

Pipeline

 

 

When possible, prefer uncompressed image and video formats that are less demanding to decompress.

 

Python

 

Nuke is highly flexible due to its compatibility with Python. Use scripts to automate repetitive tasks.

 

Templates

 

Create templates for common project setups or specific node configurations.

You can find a good template free on the shop !

nuke cache manager
nuke cache manager

I hope this lesson has served you well !

4. Sources

Sources

 

https://www.foundry.com/products/nuke-family/nuke
https://www.wetafx.co.nz/research-and-tech/technology/deep-compositing
https://learn.foundry.com/nuke/content/reference_guide/3d_nodes/project3d.html

Images


 

https://mediakwest.com/outils-weta-digital-au-service-des-vfx/
https://www.wetafx.co.nz/films/filmography/rise-of-the-planet-of-the-apes

bottom of page