class

ExpressionModule

Per-particle script (FParticleExpression): the author's own math at spawn or every update, where the fixed modules run out — a spiral, a colour that follows speed, a size pulse. A spawn script runs on the CPU for both simulation modes (GPU particles are spawned by the CPU); an update script on a GPU emitter runs in the GPU expression pass, on the same bytecode.

Module
Particles
Header
#include "Particles/ParticleModule.h"
Namespace
Mowo

Properties

TypeNameDescription
boolonSpawnDefault false.
std::stringsource
float params[4] =

Public functions

ReturnsNameDescription
voidOnSpawn
voidOnUpdateRange
const char*GetTypeName
Scope<ParticleModule>Clone
boolPrepareCompiles when the source or the emitter's attribute table changed since the last call; false with CompileError() set when it does not parse.
const std::string&CompileError
const FParticleExpression&Program
voidSetAttributesThe custom attributes every script of the emitter agreed on, in order of first mention across its modules (see ParticleSystem); attr.heat is the same particle slot in each of them.
const std::vector<std::string>&Attributes
boolAppendGpuProgramThe update script packed for the GPU expression pass, with its clock advanced the way OnUpdateRange advances it on the CPU path.

Function details

OnSpawn

C++
void OnSpawn(Particle& particle, ParticleRandom& random, const Vec3& emitterPos) override

OnUpdateRange

C++
void OnUpdateRange(Particle* particles, size_t count, float deltaTime, const float* normalizedAges) override

GetTypeName

C++
const char* GetTypeName() const override

Clone

C++
Scope<ParticleModule> Clone() const override

Prepare

C++
bool Prepare()

Compiles when the source or the emitter's attribute table changed since the last call; false with CompileError() set when it does not parse.

CompileError

C++
const std::string& CompileError() const

Program

C++
const FParticleExpression& Program() const

SetAttributes

C++
void SetAttributes(const std::vector<std::string>& attributes)

The custom attributes every script of the emitter agreed on, in order of first mention across its modules (see ParticleSystem); attr.heat is the same particle slot in each of them.

Attributes

C++
const std::vector<std::string>& Attributes() const

AppendGpuProgram

C++
bool AppendGpuProgram(float deltaTime, std::vector<uint32_t>& words)

The update script packed for the GPU expression pass, with its clock advanced the way OnUpdateRange advances it on the CPU path. False when there is nothing to run there: a spawn script, or one that does not compile.

Generated from Particles/ParticleModule.h via particles.json · Oct 31, 2026Version 1.0.0