C_SphericalTransform

C_SphericalTransform converts images between different projections, similar to the vanilla Nuke SphericalTransform node, but designed for 360 work and including Blink GPU acceleration. These view projections can be divided into two broad categories:

full frame, such as Latlong, encompassing the entire 360 world around a single point, and

partial frame, such as the Rectilinear view, that Nuke was designed to work in.

The Output rotation is also controllable using an in-viewer control system. Hold down Ctrl/Cmd+Alt and left-click and drag to move the image around, setting the pan and tilt setting. Add Shift to lock into a single dimension for the movement. In a partial frame projection, use the right mouse button to set the focal length, in essence zooming in and out.

Inputs and Controls

Connection Type

Connection Name

Function

Input

Source

The sequence you want to transform.

Control (UI)

Knob (Scripting)

Default Value

Function

C_SphericalTransform Tab

Local GPU

gpuName

N/A

Displays the GPU used for rendering when Use GPU if available is enabled. Local GPU displays Not available when:

Use CPU is selected as the GPU device in the Preferences.

no suitable GPU was found on your system.

it was not possible to create a context for processing on the selected GPU, such as when there is not enough free memory available on the GPU.

You can select a different GPU device, if available, by navigating to the Preferences and selecting an alternative from the GPU Device dropdown.

Note:  Selecting a different GPU requires you to restart Nuke before the change takes effect.

Use GPU if available

useGPUIfAvailable

enabled

When enabled, rendering occurs on the Local GPU specified, if available, rather than the CPU.

Note:  Enabling this option with no local GPU allows the script to run on the GPU whenever the script is opened on a machine that does have a GPU available.
You should also select this if you wish to render from the command line with the --gpu option.

See Nuke 14 Release Notes for more information on the GPUs Nuke supports.

Input

Projection

projTypeInput

Latlong

Sets the input projection type to convert from:

LatLong - the most common full 360 frame projection. Many VR pipelines use latlongs for both ingest and export due to their simplicity and wide use.

Cubemap - another full 360 projection. Each of the six faces is essentially rectilinear, so the data can be more familiar to work in.

Rectilinear - a partial frame, standard projection you're most likely familiar with.

When you’re going to or from rectilinear, you’re only able to cover part of the frame (up to virtually 180 degrees).

Fisheye - covers a number of projections, all of which emulate common optical models used in fisheye lenses. These are all partial frame projections, and so enable specific camera parameters similar to the Rectilinear projection type.

Format

packingTypeInput

Image

Sets how faces in the input cubemap are displayed:

Image

Views

Faces

Note:  The Format control is only displayed when Projection is set to Cubemap.

Packing

cubemapPackingInput

LL-Cross

Sets how faces are packed in a single image:

LL-Cross

6x1

3x2

Note:  The Packing control is only displayed when Projection is set to Cubemap and Format is set to Image.

Rotation

modeInput

Pan-Tilt-Roll

Sets the input rotation mode:

Look - adds an directionInput widget to the Viewer allowing you to control the rig's look direction.

From-To - adds fromInput and toInput widgets to the Viewer allowing you to transform the rig by moving the widgets around.

Pan-Tilt-Roll - allows you to transform the rig using the Pan Tilt Roll controls.

Rotation Angles - allows you to rotate the rig using the Rotation Order and Rotation Angles controls.

Type

fisheyeTypeInput

Equidistant

Sets the type of input fisheye lens:

Stereographic - also known as 'little planet' and includes some Samyang lenses. Uses the following equation:

(focal * tan(ray_angle))

Equidistant - considered the 'ideal' reference model for fisheye lenses. Uses the following equation:

(focal * ray_angle)

Equisolid - the majority of fisheye lenses fall into this category. Uses the following equation:

(2 * focal * sin(ray_angle/2))

Orthographic - an uncommon lens model, notably includes the Yasuhara Madoka 180. Uses the following equation:

(focal * sin(ray_angle))

Pan Tilt Roll

panTiltRollInput

0, 0, 0

When Rotation is set to Pan-Tilt-Roll, allows you to transform the rig manually.

Output

Projection

projTypeOutput

Latlong

Sets the output projection type to convert from:

LatLong - the most common full 360 frame projection. Many VR pipelines use latlongs for both ingest and export due to their simplicity and wide use.

Cubemap - another full 360 projection. Each of the six faces is essentially rectilinear, so the data can be more familiar to work in.

Rectilinear - a partial frame, standard projection you're most likely familiar with.

When you’re going to or from rectilinear, you’re only able to cover part of the frame (up to virtually 180 degrees).

Fisheye - covers a number of projections, all of which emulate common optical models used in fisheye lenses. These are all partial frame projections, and so enable specific camera parameters similar to the Rectilinear projection type.

Format

packingTypeOutput

Image

Sets how faces in the output cubemap are displayed:

Image

Views

Faces

Note:  The Format control is only displayed when Projection is set to Cubemap.

Packing

cubemapPackingOutput

LL-Cross

Sets how faces are packed in a single image:

LL-Cross

6x1

3x2

Note:  The Packing control is only displayed when Projection is set to Cubemap and Format is set to Image.

Face

cubemapFace

+X

Sets which face is output:

+/-X

+/-Y

+/-Z

Note:  The Face control is only displayed when Projection is set to Cubemap and Format is set to Faces.

Rotation

modeOutput

Pan-Tilt-Roll

Sets the output rotation mode:

Look - adds an directionInput widget to the Viewer allowing you to control the rig's look direction.

From-To - adds fromInput and toInput widgets to the Viewer allowing you to transform the rig by moving the widgets around.

Pan-Tilt-Roll - allows you to transform the rig using the Pan Tilt Roll controls.

Rotation Angles - allows you to rotate the rig using the Rotation Order and Rotation Angles controls.

Type

fisheyeTypeOutput

Equidistant

Sets the type of output fisheye lens:

Stereographic - also known as 'little planet' and includes some Samyang lenses. Uses the following equation:

(focal * tan(ray_angle))

Equidistant - considered the 'ideal' reference model for fisheye lenses. Uses the following equation:

(focal * ray_angle)

Equisolid - the majority of fisheye lenses fall into this category. Uses the following equation:

(2 * focal * sin(ray_angle/2))

Orthographic - an uncommon lens model, notably includes the Yasuhara Madoka 180. Uses the following equation:

(focal * sin(ray_angle))

Pan Tilt Roll

panTiltRollOutput

0, 0, 0

When Rotation is set to Pan-Tilt-Roll, allows you to transform the rig manually.

Metadata

metaDataOperation

Ignore

Sets how incoming metadata is handled:

Ignore - any metadata present in the stream is passed downstream unaltered.

Apply - rotates the image according to the metadata in the stream and the total transform described by the controls in the C_SphericalTransform node.

Note:  This option assumes that the incoming image is in LatLong space.

Transform - sets the output metadata to the sum of the input metadata and the total transform described by the controls in the C_SphericalTransform node, but does not modify the output image.

Filter

resampleType

Cubic

Select the filtering algorithm to use when remapping pixels from their original positions to new positions.

As a general guideline, the filters increase in quality at the cost of processing time as you move down the list. Bilinear filtering is the fastest and Lanczos the sharpest.

Format

formatMode

To Scale

Sets which format to use or how to compute it starting from the input:

To Format - force the specified input format as the output format. When using camera type projections, such as Rectilinear, the sensor size y parameter is ignored.

To Width - the output format has the specified input width, but the height is computed according to the output Projection format ratio.

To Scale - the output format width is computed from the input format width, and the height is computed according to the output Projection format ratio.

Width

scale

1

Sets the scaling factor to convert input width to output width.

Adjust BBox

adjustBBox

0

Increases the size of the output image bounding box.

You might want to expand the bounding box if you need access to pixels at the edge of the image for nodes such as Blur or LensDistortion.

Swap Input/Output

swap

N/A

Click to swap the Input and Output control settings.

Export

Export menu

exportMenu

C_SphericalTransform (Inverted Linked)

Sets the export nodes to add to the Node Graph:

C_SphericalTransform (Inverted Linked) - creates an expression linked C_SphericalTransform set to invert the current transforms.

This can be useful when switching between rectilinear and latlong to perform VFX tasks, such as roto.

C_SphericalTransform (Concatenated) - sets the current C_SphericalTransform node to Input+Output mode and creates a second C_SphericalTransform node in Input mode.

This can be used to create incremental latlong rotations without introducing unnecessary filtering hits by passing only metadata downstream until the final C_SphericalTansform in the node tree performs the concatenated rotation.

Create

exportButton

N/A

Click to create the export specified in the export dropdown.

Input Tab - These controls are only enabled when Input > Projection is set to Rectilinear or Fisheye.

Camera Settings

K

KInput

0, 0, 0

Sets the input camera's distortion coefficient on the xyz axes.

Shift

shiftInput

0, 0

Sets the input lens's center shift on the xy axes.

Focal

focalInput

16

Sets the focal length used for the input cameras.

Sensor

sensorInput

36, 24

Sets the sensor size used for the input cameras.

Film Back Preset

filmBackPresetInput

Custom

Sets the camera Sensor and Focal automatically for the preset selected.

Position

positionInput

0, 0, 0

Sets the position of the input camera with respect to the center of the sphere.

Copy from output

copyOutputToInput

N/A

Click to duplicate the values from the Output tab.

Output Tab - These controls are only enabled when Output > Projection is set to Rectilinear or Fisheye.

Camera Settings

K

KOutput

0, 0, 0

Sets the output camera's distortion coefficient on the xyz axes.

Shift

shiftOutput

0, 0

Sets the output lens's center shift on the xy axes.

Focal

focalOutput

16

Sets the focal length used for the output cameras.

Sensor

sensorOutput

36, 24

Sets the sensor size used for the output cameras.

Film Back Preset

filmBackPresetOutput

Custom

Sets the camera Sensor and Focal automatically for the preset selected.

Position

positionOutput

0, 0, 0

Set the position of the output camera with respect to the center of the sphere.

Copy from input

copyInputToOutput

N/A

Click to duplicate the values from the Input tab.