| name | add-effects |
|---|---|
| description | Use when adding visual effects to a PlayCanvas app, to choose between particle systems, shader chunks, runtime meshes, and post-processing. |
Pick the Engine building block first, then adapt its closest official example with
find-examples:
- Particle systems: the
particlesystemcomponent (graphics/particles-*examples). - Custom shading on existing surfaces:
StandardMaterialchunk overrides (override-shader-chunks), or aShaderMaterialwhen the effect needs its own shader pair. - Procedural or per-frame geometry: a runtime-updated
Meshon arendercomponent (graphics/mesh-*examples), orWideLineRendererfor lines with width. - Full-screen effects:
CameraFrame(light-scene). - Gaussian splat effects: the shipped gsplat scripts (
reuse-scripts).
CurveSettakes one key array per channel. A flattened array type-checks, then fails at texture upload.- Create emitters and meshes at load and reuse them. Fire an emitter with
reset()thenplay(); one-shots useloop: false. - The first use of a shader stalls a frame. Render each effect once behind a loading screen.
- Animate values with
setParameter, not a per-framematerial.update(). - A lit material on a custom mesh needs normals; otherwise use an unlit material.
Trigger each effect through the app's real inputs, and confirm repeated triggers keep entity counts stable.