Docs 3D and Particles

ParticlesGpuUltimate

A GPU particle system driven by images: a thresholded source emits particles, and look, life, turbulence, wind and force fields shape them, each optionally read from its own image, with a feedback pass for trails and one rendered output.

⁂ 3D and Particles ◆ Patreon · Pro

Why use it

Getting particles to pour out of a picture, take on its colours and be pushed around by other pictures is a lot of plumbing around a particle system: thresholding the image into birth positions, sampling its colour, a lookup for every force that should follow an image, then a render and a feedback pass for trails.

ParticlesGpuUltimate is that plumbing, built around particlesGpu, the GPU particle system from TouchDesigner's palette. An image goes in and the rendered particles come out as one TOP.

Features

How to use it

  1. Create it from the FNS tab of the OP Create dialog.
  2. Wire an image or a movie into in_main. Particles are born where its pixels pass the threshold on the Source page (Comparator, RGB and Source Threshold), and they carry the colour of the pixel they came from.
  3. The output is the render, at Render Res on the pGpu page. The Source page decides what sits behind it: raise Under Opac to show the source image underneath, or switch on Comp Over Background Color and pick Bgcolor for a plain colour.
  4. Set the look on the Look page: Material, the SOP shape for each particle and Particle Size Max. Avoid the Constant material with the Point shape: that pairing raises a texture coordinate error inside the operator.
  5. Set how long particles live on the Life page with Life and Lifevariance. On the Look page, Fade In and Fade Out fade them at either end of their life, and the Fade to settings shrink or dim them as they age.
  6. Get them moving: turbulence on the Turb page, wind on the Wind page, and forces you place on the Forces page (see below).
  7. Trails come from the feedback pass on the Post page. Opacity sets how long a trail lingers and Dry / Wet Mix blends the plain render with the trailed one.

If the particles look dim, lower Drag on the pGpu page and Fade In on the Look page. Reset on the pGpu page starts the system over and Pause freezes it.

Steering with images

Turbulence and wind read an image and act differently on its dark and bright parts. Each page has a Dark Side and a Bright Side: give the dark side strong turbulence and the bright side none, and particles churn in the shadows and sail through the highlights.

  • Life, Turbulence and Wind each read their own image when you connect one: in_life_source, in_turb_source and in_wind_source. That way a different picture can decide where particles live longer, swirl or drift than the one that emits them.
  • InitPos/CurrPos on the Life, Turb and Wind pages picks where that image is read: where the particle was born, or where it is now.
  • To let an image set each particle's life, set Life Type to Effector. To Range (dark/bright) sets the life its darkest and brightest parts map to.

Placing forces

The Forces page holds force fields placed in the particle space, one block each, and a block does nothing until you give it a Force Amount. A negative amount reverses it.

  • A Radial force pushes particles away from its position, or pulls them in with a negative amount.
  • An Axial force pushes them along its direction.
  • A Vortex turns them around its direction.
  • A Spiral turns them around and draws them inward at once, like water going down a drain.

Force Radius sets how far each one reaches. Add a block for each extra force.

Your own maps and optical flow

  • in_pos_raw and in_col_raw take position and colour maps of your own, replacing the ones derived from the source image.
  • in_optflow_raw takes an optical-flow map, and the flow pushes the particles. Optical Flow Magnitude on the pGpu page sets how hard; it ships at 0, so raise it once a flow map is wired. Optical Flow Size Remap helps the flow map line up with the system's aspect ratio.

Inputs and output

  1. in_main (TOP): the source image.
  2. in_pos_raw (TOP): optional raw position map that replaces the one derived from the source.
  3. in_col_raw (TOP): optional raw colour map.
  4. in_optflow_raw (TOP): optional optical-flow map that moves the particles (Optflow pars on the pGpu page).
  5. in_turb_source (TOP): optional image the Turb page reads as its effector.
  6. in_wind_source (TOP): optional image the Wind page reads as its effector.
  7. in_life_source (TOP): optional image the Life page reads as its effector.
  • bg (TOP): the rendered particles over the background.

Get it

This tool unlocks with Patreon. It installs through the same picker as everything else and unlocks with the Patreon Pro 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

Source

ControlType / defaultWhat it does
Source ResSourceres xyzw0 Resolution the source image is sampled at.
Interpolate Source Point PositionInterpolatepointread-only on / offon When using a low resolution source object, toggling this parameter will spawn particles from interpolated positions of the original source.
Source Thresh
ComparatorComparator menuLess How pixels are compared with the threshold to decide where particles are born.
Options: Less, Greater, Less or Equal, Greater or Equal, Equal, Not Equal
RGBRgb2 menuLuminance Which channel of the source image is compared with Source Threshold.
Options: Luminance, Red, Green, Blue, Alpha, RGB Average, RGBA Average, RGB Maximum and 1 more
Source ThresholdSourcethreshold number0.5 The brightness a pixel needs, by the comparator, to emit particles.
Source Mix
OverUnderLay SourceMenu menuInput What is composited with the particles: the input image or the thresholded source.
Options: Input, Thresholded
Under OpacSourceunderopac number1 Opacity of the source image underneath the particles.
OperationOperand menuMultiply How the source and the particles are composited.
Options: Add, Atop, Average, Brightest, Burn Color, Burn Linear, Chroma Difference, Color and 38 more
OpacOpacity2 number1 Opacity of the composited source.
Comp Over Background ColorCompover on / offoff Composite the result over the background colour.
BgcolorBgcolor colour0 The background colour.

pGpu

ControlType / defaultWhat it does
Render ResRes xyzw0 The render resolution.
CreateCreate menuname1 Specify how particles are being created. You can either create a certain number of particles all at once or create a certain number of particles on a per frame basis.
Options: By Total Number of Particles, By Particles per Frame
Max Particles in SimulationMaxparticles number409600 How many particles the simulation holds at once.
BirthBirth number10000 The number of particles spawned each frame. Only available when the Create parameter is set to "By Particles per Frame".
Random InitPosRandominitpos on / offon Birth particles at random positions inside the source instead of in order.
CameraCamera operatorempty The camera the particles are rendered through.
Projection BlendProjectionblend number0 Blend between perspective (0) and orthographic (1) projection.
LightLight operatorlight1 The light used when rendering the particles.
Hit BehaviourHit menuBounce on Contact Specify what the particle should do when leaving the bounding box.
Options: None, Die on Contact, Bounce on Contact, Avoid Bounds, Stick, Fade Out
SpeedSpeed number1 Overall speed of the simulation.
DragDrag number1 How quickly particles lose speed.
Optical Flow MagnitudeOptflowmag number0.01 Magnitude of the optical flow input force.
Optical Flow Size RemapOptflowremap xyzw1 Remaps the size of the optical flow input to help adjust to the systems aspect ratio.
PausePause on / offoff Freeze the simulation.
ResetReset button Reset the particle system.

Look

ControlType / defaultWhat it does
MaterialMaterial menuConstant Select which material type should be used for the particle system render.
Options: Constant, Phong, Line, PBR
Open MATOpen button Open the particle material to edit it.
SOPSop menuPoint The shape drawn for each particle: a point or a box.
Options: Point, Box
Particle Size MaxParticlesizemax number1 Specify the maximum size of the particle.
CompositingCompositing menuOrder-Independent Transparency How particle transparency is resolved when rendering.
Options: Alpha To Coverage, Discard Alpha, Order-Independent Transparency, No Depth Test
Alpha ThresholdAlphathreshold number0.8 Pixels of a particle below this alpha are discarded.
Fade
Fade InFadein number0.001 Specify the time in seconds a particle fades in after being spawned.
Fade OutFadeout number1 Specify the time in seconds a particle fades out before dying.
Fade to Color (Mult Alpha)Fadetocolor number1 How far particles fade toward black (multiplied alpha) over their life.
Fade to AlphaAlphafade number0 How far particles fade out over their life.
Fade to SizeFadetosize number0 How far particles shrink over their life.
Col to Size MapColtosizemap menuRed Which channel of the source colour sets particle size.
Options: Luminance, Red, Green, Blue, Alpha, RGB Average, RGBA Average, RGB Maximum and 3 more
Col to Size CrossLumtosize number0 Blend between a fixed size and a size taken from the source colour.
NormalizeNorm4 on / offoff Stretch the source colour to the full 0 to 1 range before it sets particle size.
Exponent ValueExpval number2 Exponent on the colour-to-size mapping: 1 is linear.
Size Mod InvertSizemodinvert number0 Invert the colour-to-size mapping, so darker areas give bigger particles.

Life

ControlType / defaultWhat it does
Life TypeLifetype menuConstant How life is set: the same for every particle, random, or read from an effector image.
Options: Constant, Random, Effector
LifeLife number2 The number of seconds a particle will be alive.
Life MaxLifemax number0 The longest a particle can live, in seconds.
LifevarianceLifevariance number2 A delta number of seconds that will be added or subtracted from the expected lifetime, specified in the Life parameter, of a particle.
RGBRgb menuRed Which channel of the life effector image is read.
Options: Luminance, Red, Green, Blue, Alpha, RGB Average, RGBA Average, RGB Maximum and 3 more
NormalizeNorm3 on / offoff Stretch the life effector image to the full 0 to 1 range before it is mapped.
Exponent ValueExpval2 number2 Exponent on the life effector mapping: 1 is linear.
To Range (dark/bright)Torange number0 The range the life effector is mapped to.
Works only with Random InitPos=Off
Random InitPosRandominitpos2 on / offon Birth particles at random positions (mirrors Random InitPos on the pGpu page).
InitPos/CurrPosEffectorswitchlife on / offon Where the effector image is sampled: at the position a particle was born (off) or where it is now (on).

Turb

ControlType / defaultWhat it does
Turb GainTurbgain number1 Overall strength of the turbulence.
Trub Effector ExponentTurbexpval number2 Exponent on the turbulence effector image: 1 is linear.
Turb SeedTurbseed1 number0 Random seed of the turbulence noise.
Turb Trans SpeedTurbtrans xyzw0 How fast the turbulence noise moves on each axis.
RgbRgbturb menuLuminance Which channel of the turbulence effector image is read.
Options: Luminance, Red, Green, Blue, Alpha, RGB Average, RGBA Average, RGB Maximum and 3 more
NormalizeNorm on / offoff Stretch the turbulence effector image to the full 0 to 1 range before it is mapped.
Dark Side
TurbTurb xyzw0 Turbulence on the dark side of the effector image, per axis.
Turb PeriodTurbperiod1 number0.5 Scale of the turbulence noise: larger periods give broader swirls.
Turb MagTurbmag number0 Strength of the dark-side turbulence.
Bright Side
TurbTurb1 xyzw0 Turbulence on the bright side of the effector image, per axis.
Turb Period2Turbperiod2 number0.5 Scale of the bright-side turbulence noise: larger periods give broader swirls.
Turb MagTurbmag1 number0 Strength of the bright-side turbulence.
InitPos/CurrPosEffectorswitchturb on / offon Where the effector image is sampled: at the position a particle was born (off) or where it is now (on).

Wind

ControlType / defaultWhat it does
WindgainWindgain number0 Overall strength of the wind.
Wind Effector ExponentWindexpval number2 Exponent on the wind effector image: 1 is linear.
RgbRgbwind menuLuminance Which channel of the wind effector image is read.
Options: Luminance, Red, Green, Blue, Alpha, RGB Average, RGBA Average, RGB Maximum and 3 more
NormalizeNorm2 on / offoff Stretch the wind effector image to the full 0 to 1 range before it is mapped.
Dark Side
WindWind1 xyzw0 Wind direction on the dark side of the effector image.
WindMagWindmag1 number0 Strength of the dark-side wind.
Wind VarianceWindvariance number0 Random variation of the dark-side wind.
Bright Side
WindWind xyzw0 Wind direction on the bright side of the effector image.
WindMagWindmag number0 Strength of the bright-side wind.
Wind VarianceWindvariance1 number0 Random variation of the bright-side wind.
InitPos/CurrPosEffectorswitchwind on / offon Where the effector image is sampled: at the position a particle was born (off) or where it is now (on).

Forces

ControlType / defaultWhat it does
ForcesForces sequence0 Extra forces placed in the scene, one block each.
Force TypeForces0forcetype menu2 The shape of this force: Radial acts outward from its position (inward with a negative amount), Axial along its direction, Vortex around its direction, Spiral around and inward at once.
Options: Radial, Axial, Vortex, Spiral
ForceposForces0forcepos xyzw0 Where this force sits in particle space.
Force RadiusForces0forceradius number1 How far this force reaches from its position.
Force AmountForces0forceamount number0 Strength of this force; a negative amount reverses it.
ForcedirForces0forcedir xyzw0 The axis this force acts along (Axial) or around (Vortex, Spiral).
Force TypeForces1forcetype menu2 The shape of this force: Radial acts outward from its position (inward with a negative amount), Axial along its direction, Vortex around its direction, Spiral around and inward at once.
Options: Radial, Axial, Vortex, Spiral
ForceposForces1forcepos xyzw0 Where this force sits in particle space.
Force RadiusForces1forceradius number1 How far this force reaches from its position.
Force AmountForces1forceamount number0 Strength of this force; a negative amount reverses it.
ForcedirForces1forcedir xyzw0 The axis this force acts along (Axial) or around (Vortex, Spiral).

Post

ControlType / defaultWhat it does
OperationOperand1 menuMultiply How the feedback trail is combined with the new frame.
Options: Add, Atop, Average, Brightest, Burn Color, Burn Linear, Chroma Difference, Color and 38 more
OpacityOpacity number0.9 Opacity of the feedback trail.
Filter SizeSize number7 Blur applied to the feedback trail each frame, in pixels.
ResetReset1 momentaryoff Clear the feedback trail.
Dry / Wet MixDrywet number1 Mix between the plain render (0) and the render with its feedback trail (1).