samplePoints

Where particles should appear: inside a source's opaque area (a text, a layer prop, a pass).

samplePoints(source: InputNode | PropRef): {readonly fromShape: InputNode | PropRef}

Import samplePoints from shaders/std.

Hand it to simulate.particles as spawn.

Parameters

NameTypeNotes
sourceInputNode | PropRef

Example

const logo = text('SHADERS', {size: 0.3})
// …
inputs: {
  logo,
  dust: simulate.particles({count: 30000, spawn: samplePoints(logo), forces: [{spring: 3}, {cursor: 1}, {drag: 0.6}]}),
},

Keep reading