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
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.
What it is
LayerSep3D is a Geometry COMP that turns one image into a stack of planes. Each of the Layers slices the input by a threshold on the channel you pick, so the bright parts land on one plane and the dark parts on another, with a soft edge between. The planes are instanced along Z, and every per layer value (threshold, softness, mix, offset, scale, rotation) is a curve over the layer index with an offset, amplitude, power and phase, or a CHOP you wire in. Point a camera at it and a flat picture gets depth.
It is a member of the FNS operator family: pick it from the FNS tab of the OP Create dialog and it lands as one node.
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.
Layer edges
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.
Parameters
Custom
| Control | Type / default | What 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. |
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
| Control | Type / default | What 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
| Control | Type / default | What 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. |
FilterInstancetexfilter |
menuMipmap Linear | Texture filtering used when the quads sample the layer texture. |
AuthorAuthornameread-only |
textFunction Store (@function.str) | Author of the component. |
Author LinkOpenauthor |
button | Opens the author page in the browser. |