Docs 3D and Particles

LayerSep3D

Slices an image into depth layers by a channel threshold and instances them as a stack in 3D, with per layer threshold, softness, mix, position, scale and rotation driven by curves or CHOPs.

⁂ 3D and Particles ◆ Patreon · Base

Why use it

Pulling a flat picture apart by brightness into planes at different depths is a classic 2.5D look, and a moving camera turns it into parallax. Built by hand, it is one Threshold TOP per band, a Texture 3D TOP to stack them, and instancing to space the planes, and changing the number of layers means rebuilding the chain.

LayerSep3D is that stack in one Geometry COMP. Set how many layers you want and how they spread, and every value that changes from layer to layer is a curve you shape with a few parameters, or a CHOP you wire in.

Features

How to use it

  1. Create it from the FNS tab of the OP Create dialog. It lands as one Geometry COMP.
  2. Wire the image to slice into in_mask, and wire the same image into in_color to see it on the layers. With in_color empty the layers show an internal colour noise.
  3. Add a Camera COMP and a Render TOP beside it. The Render TOP draws LayerSep3D like any other Geometry COMP. Move the camera off to the side to see the planes come apart.
  4. Set Layers to the number of planes, and Mode to the value that sorts a pixel into a layer: Luminance for brightness, Alpha for a cut-out, or a single channel.
  5. Fit the slicing to your image with Threshold Range: the range of mask values the layers are spread across. An image that only uses the middle of the range puts most of itself on a few planes until you narrow it.
  6. Spread the stack in depth with Z Amplitude on the Transform page.
  7. Soften the cut between layers with Softness Offset.

To check what a single layer holds, switch on Single Layer and step through the layers with Select Layer.

Shaping the stack

Every value that changes from layer to layer (threshold, softness, mix, depth, scale and rotation) is a ramp from the first layer to the last, set by four parameters:

  • Offset adds the same amount to every layer.
  • Amplitude sets how much the value changes from the first layer to the last.
  • Power bends the ramp, so the change bunches toward one end.
  • Phase rotates the ramp across the layers, so it wraps around. Rotation has Rotation Invert in its place, which runs the ramp backwards.

A few looks to start from:

  • Cut paper or a solid block. With the mix at 0 each layer holds only its own band, like sheets of cut paper. Raising Mix Offset toward 1 keeps everything from that layer upward in each slice, so the planes overlap into something closer to a solid.
  • A fan or a tunnel. Rotation Amplitude turns each layer a little further than the one before, and Scale Amplitude grows them.
  • Uneven depth. Z Power bunches the planes toward the front or the back.

The Texture Index section changes which layer each plane shows, without changing how the image is sliced: Invert Texture Index runs the order backwards, Texture Index Period repeats the sequence, and Randomize Seed shuffles it. Reverse Layer Order flips the slices themselves, so layer 0 becomes the brightest band.

Driving layers from CHOPs

Threshold, softness and mix can each come from a CHOP with one sample per layer: wire it into in_threshold, in_softness or in_mix, or point Threshold CHOP (override), Softness CHOP (override) or Mix CHOP (override) at it. The CHOP replaces that parameter curve.

  • Thresholds should rise from layer to layer. A threshold CHOP that does not (a sine across the layers, say) puts nearly the whole image on one plane.
  • The edge between layers j-1 and j uses softness j-1.

Per-layer Z, scale and rotation can also be overridden in the instancing.

Inputs and outputs

  • in_mask (TOP): the image that is sliced.
  • in_color (TOP): the colour drawn on the layers, when different from the mask.
  • in_threshold, in_softness, in_mix (CHOP): optional per layer curves that override the parameter curves.
  • out_layers (TOP): the layer stack as a 2D texture array or 3D texture, for your own instancing.

Get it

This tool unlocks with Patreon. It installs through the same picker as everything else and unlocks with the Patreon Base tier or higher, connected from inside TouchDesigner. Everything else in the toolkit stays free and MIT, and the membership is what keeps that work moving.

Join on Patreon → How unlocking works →

Parameters

Custom

ControlType / defaultWhat it does
LayersLayers number10 Number of layers the input is split into (the depth of the output texture and the number of instanced quads). The threshold range is divided into this many equal bands, one per layer. Minimum 2.
Reverse Layer OrderReverse on / offoff Flips the order of the layers in the output texture: layer 0 becomes the brightest band instead of the darkest.
Open MaterialOpen button Opens the parameter dialog of the material the layers are rendered with.
ModeMode menuLuminance Which value of the mask pixel is compared against the thresholds: luminance, a single channel, or an average, maximum or minimum of the channels.
Options: Luminance, Red, Green, Blue, Alpha, RGB Avg, RGBA Avg, RGB Max and 3 more
Threshold OffsetThoffs number0 Added to every layer threshold before the range mapping. Positive values push all band edges up.
Threshold AmplitudeThamp number1 Scales the spread of the thresholds. 1 spreads the bands over the whole range, smaller values squeeze them toward the bottom, negative values reverse the ramp.
Threshold RangeThrange number0 Mask values (min, max) the layers are spread across. The range is split into Layers equal bands: the first layer also takes everything below the range, the last layer everything above its lower edge.
Threshold PowerThreshpow number1 Exponent applied to the threshold ramp. 1 = equal bands, above 1 = thinner bands at the bottom, below 1 = thinner bands at the top.
Threshold PhaseThphase number0 Rotates the threshold ramp across the layers (0 to 1), so the band order wraps around.
Threshold CHOP (override)Threshold operatorNone Optional CHOP with one sample per layer that replaces the generated thresholds. Leave empty to use the Threshold parameters above (a CHOP wired to the threshold input also overrides them).
Softness OffsetSoftoffset number0 Softness added to every layer edge. Softness is the width of the blend between neighbouring layers, in mask units.
Softness AmplitudeSoftamp number0 How much the softness ramps across the layers, from 0 at the first layer to this value at the last.
Softness PowerSoftpow number1 Exponent applied to the softness ramp across the layers.
Softness PhaseSoftphase number0 Rotates the softness ramp across the layers (0 to 1).
Softness CHOP (override)Softness operatorNone Optional CHOP with one sample per layer that replaces the generated softness values.
Mix AmplitudeMixamp number0 How much of the content above each layer is left in it, ramped across the layers. 0 = each layer holds only its own band.
Mix OffsetMixoffset number0 Mix added to every layer. 1 keeps everything from the layer upward in each slice.
Mix PowerMixpow number1 Exponent applied to the mix ramp across the layers.
Mix PhaseMixphase number0 Rotates the mix ramp across the layers (0 to 1).
Mix CHOP (override)Mix operatorNone Optional CHOP with one sample per layer that replaces the generated mix values.
Texture Index
Invert Texture IndexInvert2 number0 Blends the texture index each quad samples from normal (0) to reversed (1), so the quad order and the layer order can run against each other.
Texture Index PhasePhase number0 Shifts which layer each instanced quad samples, as a phase of the index ramp.
Texture Index ExponentExpval number1 Exponent applied to the texture index ramp. 1 = one layer per quad in order; other values bunch the layers toward one end.
Texture Index PeriodPeriod number1 Period of the texture index ramp across the quads. 1 = each layer once; smaller values repeat the layer sequence.
Randomize SeedRandomize number0 When above 0, shuffles which layer each quad samples, using this value as the seed. 0 = no shuffle.
Single LayerSingle on / offoff Every quad samples the same layer, chosen by Select.
Select LayerSelect number0 The layer every quad shows while Single Layer is on (0 = first layer).

Transform

ControlType / defaultWhat it does
These can be overridden in the instancing...
Z OffsetTzoffset number0 Z position added to every quad.
Z AmplitudeTzamplitude number1 Total Z spread of the quads, from the first layer to the last.
Z PowerTzpow number1 Exponent applied to the Z spread, so the quads bunch toward the front or the back.
Z PhaseTzphase number0 Rotates the Z ramp across the quads (0 to 1).
Scale OffsetScaleoffset number1 Uniform scale of every quad (1 = original size).
Scale AmplitudeScaleamplitude number0 How much the scale ramps across the quads, added on top of Scale Offset.
Scale PowerScalepow number1 Exponent applied to the scale ramp across the quads.
Scale PhaseScalephase number0 Rotates the scale ramp across the quads (0 to 1).
Rotation OffsetRotoffset number0 Z rotation in degrees added to every quad.
Rotation AmplitudeRotamplitude number0 How many degrees the rotation ramps across the quads.
Rotation PowerRotpow number1 Exponent applied to the rotation ramp across the quads.
Rotation InvertRotinvert number0 Blends the rotation ramp from normal (0) to reversed (1).

Common

ControlType / defaultWhat it does
Output TypeType menu2D Texture Array 2D Texture Array keeps each layer as its own slice (smooth mipmaps); 3D Texture lets the instance texture index interpolate between layers.
Options: 2D Texture Array, 3D Texture
FilterInstancetexfilter menuMipmap Linear Texture filtering used when the quads sample the layer texture.
Options: Nearest, Linear, Mipmap Linear
AuthorAuthornameread-only textFunction Store (@function.str) Author of the component.
Author LinkOpenauthor button Opens the author page in the browser.