ScanlineRender2

When connected to a GeoScene or GeoMerge node, the ScanlineRender node renders all the objects and lights connected to that scene from the perspective of the Camera connected to the cam input (or a default camera if no cam input exists). The rendered 2D image is then passed along to the next node in the Node Graph, and you can use the result as an input to other nodes in the script.

The ScanlineRender node can also output deep data if there is Deep data available from the scene graph.

See also GeoScene, GeoMerge, and Camera.

Tip:  ScanlineRender2's classic 3D system equivalent is the ScanlineRender node.

Inputs and Controls

Connection Type

Connection Name

Function

Input

cam

An optional camera input. The scene is rendered from the perspective of this camera. If the camera input is not connected, ScanlineRender uses a default camera positioned at the origin and facing in the negative Z direction.

obj/scn

Either:

A GeoScene or GeoMerge node that is connected to the objects and lights you want to render, or

a 3D object or prim.

bg

An optional background input. This can be used to composite a background image into the scene and to determine the output resolution. If not used, this defaults to root.format or root.proxy_format defined in the ProjectSettings.

If this input contains a depth channel, ScanlineRender considers it when doing Z-buffer and Z-blending calculations.

Control (UI)

Knob (Scripting)

Default Value

Function

ScanlineRender Tab

Objects Mask

objects_mask

//*

Specifies the mask pattern to match prim names to include in the output scene, excluding light prims such as DirectLight1.

The default mask, //*, includes everything from the root of the scene graph. As you can see, you can use standard glob-style variables, such as /*, to create masks or use individual prim names separated by spaces. For example, /GeoCube1 /GeoCard3 includes only those prims in the output scene.

Tip:  You can also use the cog menu, the Viewer picker, or drag and drop paths from the Scene Graph to create masks.

Light Mask

lights_mask

//*

Specifies the mask pattern to match light names to include in the output scene, excluding object prims such as GeoCube1.

The default mask, //*, includes everything from the root of the scene graph. As you can see, you can use standard glob-style variables, such as /*, to create masks or use individual prim names separated by spaces. For example, /DirectLight1 /PointLight4 includes only those light prims in the output scene.

Tip:  You can also use the cog menu, the Viewer picker, or drag and drop paths from the Scene Graph to create masks.

transparency

transparency

on

When enabled, objects appear transparent where their alphas are less than 1.

Z-buffer

ztest_enabled

on

Enable or disable the Z-buffer which compares object Z-depth within a scene, assisting with occlusions.

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.

Antialiasing

antialiasing

none

Sets the level of antialiasing to reduce any aliasing artifacts in the render. Choose from none, low, medium and high.

Z-blend mode

zblend_mode

none

Type of ramp to use to blend two surfaces within the Z-blend range of each other. Smooth looks better, but linear is provided for back-compatibility.

Z-blend range

zblend_range

0.1

Any two surfaces closer together than this distance on the Z axis are blended together to smooth the transition between intersecting objects.

Projection Mode

projection_mode

render camera

The projection modes are:

perspective - have the camera’s focal length and aperture define the illusion of depth for the objects in front of the camera.

orthographic - use orthographic projection (projection onto the projection plane using parallel rays).

uv - have every object render its UV space into the output format. You can use this option to cook out texture maps.

spherical - have the entire 360-degree world rendered as a spherical map. You can increase tessellation max to increase the accuracy of object edges as they are warped out of line, but this takes longer to render.

render camera - use the projection type of the render camera.

Tessellation Max

max_tessellation

3

Limits recursive subdivision of polygons by a screen-space distance percentage.

This control can be useful in the spherical projection mode, which sometimes distorts object edges. If you see such distortions, you can try increasing this value to tessellate (subdivide) polygons into smaller polygons. This produces more accurate object edges, but also takes longer to render.

Overscan

overscan

0

The maximum additional pixels to render beyond the left/right and top/bottom of the frame. Rendering pixels beyond the edges of the frame can be useful if subsequent nodes need to have access outside the frame. For example, a Blur node down the node tree may produce better results around the edges of the frame if overscan is used. Similarly, a subsequent LensDistortion node may require the use of overscan.

Lighting

lighting_enable_mode

auto

Controls whether or not lights in the scene affect the 2D output. Selecting off ignores the effect of any lights in the scene in the 2D Viewer, but you can still see the light's effect in the 3D Viewer.

Ambient

ambient

0

Enter a value between 0 (black) and 1 (white) to change the global ambient color.

MultiSample Tab

Samples

samples

1

Sets the number of samples to render per pixel, to produce motion blur and antialiasing. If you use this, in most cases you can turn off the antialiasing and filter controls on the ScanlineRender tab.

Shutter

shutter

0.5

Enter the number of frames the shutter stays open when motion blurring. For example, a value of 0.5 corresponds to half a frame.

Shutter Offset

shutteroffset

start

This value controls how the shutter behaves with respect to the current frame value. It has four options:

centred - center the shutter around the current frame. For example, if you set the shutter value to 1 and your current frame is 30, the shutter stays open from frame 29,5 to 30,5.

start - open the shutter at the current frame. For example, if you set the shutter value to 1 and your current frame is 30, the shutter stays open from frame 30 to 31.

end - close the shutter at the current frame. For example, if you set the shutter value to 1 and your current frame is 30, the shutter stays open from frame 29 to 30.

custom - open the shutter at the time you specify. In the field next to the dropdown menu, enter a value (in frames) you want to add to the current frame. To open the shutter before the current frame, enter a negative value. For example, a value of - 0.5 would open the shutter half a frame before the current frame.

shuttercustomoffset

0

If the shutter offset parameter is set to custom, this parameter is used to set the time that the shutter opens by adding it to the current frame. Values are in frames, so -0.5 would open the shutter half a frame before the current frame.

Randomize Time

temporal_jitter

0

Adds randomness to the distribution of samples in time so they don’t produce regularly spaced images. The larger the value, the larger the time difference between the samples.

Sample Diameter

spacial_jitter

1

The diameter of the circle that the samples for each pixel are placed in for antialiasing. The larger the value, the more pixels are jittered.

Focus Diameter

focal_jitter

0

Randomly orbit the camera about a point at the focal distance in front of it for each sample to produce depth-of-field effects from multiple samples.

Note:  The focal distance is set in the Camera node's controls, in the Projection tab.

Stochastic Samples

stochastic_samples

0

Sets the number of samples, per pixel, to use in stochastic estimation (zero is disabled). Lower values result in faster renders, while higher values improve the quality of the final image.

Stochastic sampling is based on Robert L. Cook’s Stochastic Sampling in Computer Graphics, available in ACM Transactions on Graphics, Volume 6, Number 1, January 1996.

Note:  It is recommended for motion blur that the samples control is adjusted. This also provides anti-aliasing by jittering the sample point.

Uniform Distribution

uniform_distribution

off

When enabled, use a uniform temporal distribution of scenes to sample. This generates more accurate results for stochastic multisampling.

Shader Tab

Motion Vectors

motion_vectors_type

distance

Select how to render motion vectors:

off - do not render motion vectors.

classic - render motion vectors the classic (pre-Nuke 6.1) way. This option is only provided for backwards compatibility, and isn't always accurate.

velocity - store the velocity of every single pixel in the motion vector channels (pre-Nuke 7.0 way). This option is only provided for backwards compatibility. In order to have the same behavior as Nuke 6.3, set samples to 1.

distance - for every pixel, store the distance (in pixels) between samples in the motion vector channels. This is the recommended option that usually produces the best results. It also allows the VectorBlur node to produce curved vector blur where interpolation between two frames is made according to a curve rather than linearly.

Motion Vector Channels

MB_channel

forward

The channels the motion vectors are output to.

You can use the checkboxes on the right to select individual channels.

Output Vectors

output_shader_vectors

off

When enabled, shader vectors (surface points and surface normals) are output as well as motion vectors. These can be useful if you want to relight the rendered 3D scene in the compositing phase.

Surface Point

P_channel

none

The channel to use as the surface point channel. When output vectors is enabled, ScanlineRender outputs the surface point positions (in world space coordinates) into this channel.

Surface Normal

N_channel

none

The channel to use as tShe surface normal channel. When output vectors is enabled, ScanlineRender outputs the surface point normals (in world space coordinates) into this channel.

Deep Tab

Drop Zero Alpha Aamples

drop_zero_alpha_samples

enabled

When enabled, deep samples with an alpha value of 0 do not contribute to the output.

When disabled, deep samples with an alpha value 0 contribute to the output.

Step-by-Step Guides

The ScanlineRender Node

Adding Motion Blur Using a Renderer

Rendering a 3D Scene