class

ParticleSystem

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

Public functions

ReturnsNameDescription
voidInitialize
voidShutdown
voidUpdate
boolDeclaresComponentAccessReads where each emitter stands, writes only the emitters themselves: it creates no entities and adds no components.
ComponentMaskGetReadMask
ComponentMaskGetWriteMask
voidSetSceneDriven
voidTickParticles
voidSubmitForRenderingSubmit particle data to renderer (call for editor preview without full Update)
voidSubmitForRenderingThe same submission for emitters the caller names, without walking the World.
voidSetCameraPositionSet camera position for billboard orientation
const Vec3&GetCameraPosition
voidSetCameraVectorsSet the camera view matrix (needed for GPU billboard generation)
voidSetParticleRenderer
ParticleRenderer*GetParticleRenderer
voidSetLightingParamsThe frame's main directional light and ambient/GI irradiance, used to shade billboard emitters whose shadingMode is Lit.
voidSetGPUParticleRenderer
GPUParticleRenderer*GetGPUParticleRenderer
floatGetCurrentTime
voidSetViewProjectionSet view projection matrix (GPU renderer + submission-time culling)
voidSetCullingViewProjectionEmitters whose bounds fall outside this frustum are not submitted.
uint32_tGetSubmittedEmitterCountEmitters submitted by the last SubmitForRendering, and how many the frustum/distance cull rejected — read by the self-tests.
uint32_tGetCulledEmitterCount
voidSetCollisionFieldScene representation collision modules resolve against.
const ParticleCollisionField*GetCollisionField
boolWantsDepthCollisionTrue when at least one live emitter carries a collision module that can use the depth tier.
boolWantsSdfCollisionTrue when a live CPU emitter carries a collision module that can sample the distance field, as of the last tick.
voidSetGpuCollisionField
voidBakeGPUSimParamsBake an emitter's modules into GPU sim params (public so the collision parity self-test can assert the baked CollisionModule values without a GPU).
uint32_tGetCollisionCountContacts resolved across every emitter on the last Update.
voidSetViewportSizeBackbuffer size, used to turn a world-space particle quad into an estimated pixel count for the fill budget.
voidSetOverdrawBudgetFill budget.
floatGetOverdrawBudget
floatGetEstimatedOverdrawEstimated screens of fill the last SubmitForRendering actually admitted, and how many emitters the budget rejected.
uint32_tGetFillBudgetRejectedCount
voidSetVisibilityFilterPer-view visibility veto, rebound alongside the camera.
voidSetEffectsScalabilityEffects scalability scalars applied on top of authored emitter values: spawn rate, pool size and cull distance.
floatGetSpawnRateScale
uint32_tGetMaxActiveEmitters

Function details

Initialize

C++
void Initialize(World* world) override

Shutdown

C++
void Shutdown() override

Update

C++
void Update(float deltaTime) override

DeclaresComponentAccess

C++
bool DeclaresComponentAccess() const override

Reads where each emitter stands, writes only the emitters themselves: it creates no entities and adds no components.

GetReadMask

C++
ComponentMask GetReadMask() const override

GetWriteMask

C++
ComponentMask GetWriteMask() const override

SetSceneDriven

C++
void SetSceneDriven(bool sceneDriven)

TickParticles

C++
void TickParticles(float deltaTime)

SubmitForRendering

C++
void SubmitForRendering()

Submit particle data to renderer (call for editor preview without full Update)

SubmitForRendering

C++
void SubmitForRendering(const std::vector<Entity>& roots)

The same submission for emitters the caller names, without walking the World. An editor preview records on the render thread, where iterating a World is not allowed, and it already knows its one emitter entity.

SetCameraPosition

C++
void SetCameraPosition(const Vec3& cameraPos)

Set camera position for billboard orientation

GetCameraPosition

C++
const Vec3& GetCameraPosition() const

SetCameraVectors

C++
void SetCameraVectors(const Vec3& right, const Vec3& up, const Vec3& fwd)

Set the camera view matrix (needed for GPU billboard generation)

SetParticleRenderer

C++
void SetParticleRenderer(ParticleRenderer* renderer)

GetParticleRenderer

C++
ParticleRenderer* GetParticleRenderer() const

SetLightingParams

C++
void SetLightingParams(const Vec3& direction, const Vec3& color, float intensity, const Vec3& ambient)

The frame's main directional light and ambient/GI irradiance, used to shade billboard emitters whose shadingMode is Lit. Mesh emitters are deferred-lit by the scene instead and ignore these.

SetGPUParticleRenderer

C++
void SetGPUParticleRenderer(GPUParticleRenderer* renderer)

GetGPUParticleRenderer

C++
GPUParticleRenderer* GetGPUParticleRenderer() const

GetCurrentTime

C++
float GetCurrentTime() const

SetViewProjection

C++
void SetViewProjection(const Mat4& vp)

Set view projection matrix (GPU renderer + submission-time culling)

SetCullingViewProjection

C++
void SetCullingViewProjection(const Mat4& vp)

Emitters whose bounds fall outside this frustum are not submitted. The matrix is the same view-projection used for rendering.

GetSubmittedEmitterCount

C++
uint32_t GetSubmittedEmitterCount() const

Emitters submitted by the last SubmitForRendering, and how many the frustum/distance cull rejected — read by the self-tests.

GetCulledEmitterCount

C++
uint32_t GetCulledEmitterCount() const

SetCollisionField

C++
void SetCollisionField(const ParticleCollisionField* field)

Scene representation collision modules resolve against. Owned by the caller and expected to stay valid for the frame; null disables collision without disabling the modules.

GetCollisionField

C++
const ParticleCollisionField* GetCollisionField() const

WantsDepthCollision

C++
bool WantsDepthCollision() const

True when at least one live emitter carries a collision module that can use the depth tier. The renderer reads this to decide whether the depth downsample and its readback are worth running at all — nothing pays for depth collision in a scene that does not ask for it.

WantsSdfCollision

C++
bool WantsSdfCollision() const

True when a live CPU emitter carries a collision module that can sample the distance field, as of the last tick. The host only asks the renderer for its CPU copy of the field while this holds.

SetGpuCollisionField

C++
void SetGpuCollisionField(const GpuCollisionFieldParams& field)

BakeGPUSimParams

C++
void BakeGPUSimParams(const struct ParticleEmitterComponent& emitter, const Vec3& emitterPos, GPUParticleSimParams& params) const

Bake an emitter's modules into GPU sim params (public so the collision parity self-test can assert the baked CollisionModule values without a GPU).

GetCollisionCount

C++
uint32_t GetCollisionCount() const

Contacts resolved across every emitter on the last Update.

SetViewportSize

C++
void SetViewportSize(uint32_t width, uint32_t height)

Backbuffer size, used to turn a world-space particle quad into an estimated pixel count for the fill budget. Zero disables the estimate.

SetOverdrawBudget

C++
void SetOverdrawBudget(float screensOfFill)

Fill budget. Particle cost is overdraw, not simulation, so the budget is denominated in screen coverage: an emitter's estimated covered pixels (quad areas summed, overlaps counted twice — that IS the overdraw) over the backbuffer's pixel count. A budget of 2 means "particles may cover the screen twice over". Emitters are admitted nearest-first and the first one that would blow the budget, and everything behind it, is dropped for the frame. Zero means unlimited.

GetOverdrawBudget

C++
float GetOverdrawBudget() const

GetEstimatedOverdraw

C++
float GetEstimatedOverdraw() const

Estimated screens of fill the last SubmitForRendering actually admitted, and how many emitters the budget rejected.

GetFillBudgetRejectedCount

C++
uint32_t GetFillBudgetRejectedCount() const

SetVisibilityFilter

C++
void SetVisibilityFilter(std::function<bool(EntityID)> filter)

Per-view visibility veto, rebound alongside the camera. Particles gather out of the World directly, so without this the scene's own layer mask and editor-hidden filter stop at every other renderable and let emitters through. Empty = submit everything, which is what a host with no scene (the standalone emitter tests) wants.

SetEffectsScalability

C++
void SetEffectsScalability(float spawnRateScale, float maxParticleScale, float cullDistanceScale, uint32_t maxActiveEmitters)

Effects scalability scalars applied on top of authored emitter values: spawn rate, pool size and cull distance. 1.0 leaves content untouched.

GetSpawnRateScale

C++
float GetSpawnRateScale() const

GetMaxActiveEmitters

C++
uint32_t GetMaxActiveEmitters() const
Generated from Particles/ParticleSystem.h via particles.json · Oct 31, 2026Version 1.0.0