API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classParticleMaterial

@codexo/exojs-particles / particles / stable

Material specialization for particle render modes. `Material`'s constructor is protected, so every material family declares a thin subclass that fixes target and opens construction up - this is the particle counterpart of core's `MeshMaterial` and `SpriteMaterial`. Particle draws bind their system-level state (transform, local bounds, texture) through the renderer rather than through the material, so this subclass adds no behaviour of its own; it exists to name the contract.

9
props
4
methods
0
events
Import
import { ParticleMaterial } from '@codexo/exojs-particles'

Material specialization for particle render modes.

`Material`'s constructor is protected, so every material family declares a thin subclass that fixes target and opens construction up - this is the particle counterpart of core's `MeshMaterial` and `SpriteMaterial`.

Particle draws bind their system-level state (transform, local bounds, texture) through the renderer rather than through the material, so this subclass adds no behaviour of its own; it exists to name the contract.

Constructors1
Methods4
destroy(): void
Release GPU resources cached against this material on every backend that has compiled it. Safe to call multiple times. After destroy, the material can still be re-used - renderers recompile on next draw - but typical usage is to drop the reference.
onDispose(callback: () => void): void
Hook for renderers to register a per-material-instance cleanup callback (release compiled program, pipeline, or bind groups). The callback fires on destroy; renderers MUST also tolerate the material being garbage-collected without destroy ever being called. Part of the renderer SDK contract for extension renderers.
Replace a declared uniform value, returning this for chaining. Unknown names and scalar↔texture kind changes are rejected. Only available on a material whose shader source declares no uniform schema; a typed material writes through uniforms instead.
Properties9
target: "particle"
Which drawable class this material can serve; renderers check compatibility.
bindKey: number
Stable bind key: identical ⇒ same bindings (textures unchanged). Derived from this material's identity, base-texture sampler override, and the identities of its bound textures. Changes when a texture is swapped or sampler state changes; drives bind-group/slot reuse.
pipelineKey: number
Stable pipeline key: identical ⇒ same GPU pipeline/program can be used. Derived from shader identity and blend mode, and is independent of the owning material instance so identically configured materials share a pipeline. Drives grouping and the pipeline cache.
The declared named uniform blocks, each owning its own values.
The typed accessors of the declared uniform block, or - on a source without a schema - the live user uniform values, where construction declares the fixed set of names and each name's scalar/texture kind: material.uniforms.u_time = performance.now() / 1000; material.uniforms.u_color = [1, 0.5, 0, 1];
Source