SphericalTransform

SphericalTransform converts images between different projections, including 360 rigs using the CaraVR toolset in NukeX. 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

-Z

An environment map you want to convert to another type. Input names vary according to the Project and Format selected.

Control (UI)

Knob (Scripting)

Default Value

Function

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 default blink 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, if available, by navigating to the Preferences and selecting an alternative from the default blink 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 15 Release Notes for more information on the GPUs Nuke supports.

Input

Projection

projTypeInput

LatLong

Sets the input projection type from which to convert. The type you select is dependent on what directional information your textures contain. For example, Cube has +X,+Y,+Z -X,-Y,-Z

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.

MirrorBall - A reflective ball, scaled up to fill the available area.

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.

Note:  The Focal to Shift controls are only available when Projection is set to Rectilinear or Fisheye.

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 cameras with respect to the center of the sphere.

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.

Rotation

modeInput

Pan-Tilt-Roll

Sets the input rotation mode:

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

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

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

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

Pan Tilt Roll

panTiltRollInput

0, 0, 0

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

Output

Projection

projTypeOutput

LatLong

Sets the output projection type to which the input is converted. The type you select is dependent on what directional information your textures contain. For example, Cube has +X,+Y,+Z -X,-Y,-Z

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.

MirrorBall - A reflective ball, scaled up to fill the available area.

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.

Note:  The Focal to Shift controls are only available when Projection is set to Rectilinear or Fisheye.

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

Sets the position of the output cameras with respect to the center of the sphere.

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.

Rotation

modeOutput

Pan-Tilt-Roll

Sets the output rotation mode:

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

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

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

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

Pan Tilt Roll

panTiltRollOutput

0, 0, 0

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

Filter

filter

Cubic

Select the filtering algorithm to use when remapping pixels from their original positions to new positions. This allows you to avoid problems with image quality, particularly in high contrast areas of the frame (where highly aliased, or jaggy, edges may appear if pixels are not filtered and retain their original values).

Impulse - remapped pixels carry their original values.

Cubic - remapped pixels receive some smoothing.

Keys - remapped pixels receive some smoothing, plus minor sharpening (as shown by the negative -y portions of the curve).

Simon - remapped pixels receive some smoothing, plus medium sharpening (as shown by the negative -y portions of the curve).

Rifman - remapped pixels receive some smoothing, plus significant sharpening (as shown by the negative -y portions of the curve).

Mitchell - remapped pixels receive some smoothing, plus blurring to hide pixelation.

Parzen - remapped pixels receive the greatest smoothing of all filters.

Notch - remapped pixels receive flat smoothing (which tends to hide moire patterns).

Lanczos4, Lanczos6, and Sinc4 - remapped pixels receive sharpening which can be useful for scaling down. Lanczos4 provides the least sharpening and Sinc4 the most.

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.

Output Format

output

root.format

When Format is set to To Format, specifies the output format used.

AdjustBBox

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.

CaraVR Options

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.

Export

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.