@modoki/engine / index / RenderConfig
Interface: RenderConfig
Particles
alignToVelocity?
optionalalignToVelocity?:boolean
2D: rotate each sprite to face its direction of travel (atan2(vy, vx)), with startRotation / rotationOverLife / rotationSpeed applied as an additive offset on top (so art that "points up" can be corrected once). Off by default. Ignored by the 3D billboard backend, which is always camera-facing. Central to 2D VFX: streaking sparks, tumbling debris, arrows, slashes.
anchor?
optionalanchor?:"center"|"bottom"
Billboard pivot. 'center' (default) anchors the sprite at the particle position. 'bottom' anchors the bottom edge there, so the sprite grows upward from its base — keeps a ground strike's impact planted (no apparent scaling around the middle) and lets you place the emitter on the ground plane.
aspect?
optionalaspect?:number
Billboard width/height ratio (default 1 = square). Values < 1 make a tall quad,
1 a wide one.
startSizecontrols the height; width = height × aspect. Use this to match a non-square sprite-sheet cell (e.g. a tall lightning bolt at aspect 0.5) so the texture renders without distortion or wasted transparent padding.
blend
blend:
BlendMode
meshLit?
optionalmeshLit?:boolean
mesh mode: shade with scene lighting (true) or render flat/unlit (false, default)
meshPrimitive?
optionalmeshPrimitive?:MeshPrimitive
mesh mode: which built-in primitive to instance (default 'box')
mode?
optionalmode?:"mesh"|"billboard"
'billboard' (default) = camera-facing textured quads; 'mesh' = instanced 3D primitives
offset?
optionaloffset?: [number,number]
Constant [x, y] offset of the sprite from its anchor, in units of startSize (so it scales with the particle). Applied in billboard space after the anchor: +x right, +y up. Use it to fine-tune where the art sits — e.g. nudge a bolt down so its in-texture impact point (not the cell edge) lands exactly on the ground.
renderOrder?
optionalrenderOrder?:number
draw-order hint relative to other transparent objects. In 2D this is the sprite's zIndex within its Canvas2D — use it to place particles above or below other 2D content.
softParticles?
optionalsoftParticles?:boolean
depth-based soft fade near opaque geometry (Phase 3)
spriteCycles?
optionalspriteCycles?:number
loop/pingpong: full animation cycles over the particle lifetime (default 1)
spriteMode?
optionalspriteMode?:SpriteMode
how the sprite-sheet plays over the particle lifetime (default 'once')
spriteRandomStart?
optionalspriteRandomStart?:boolean
randomize each particle's starting frame for visual variety (default false)
texture?
optionaltexture?:string
optional sprite-sheet/texture asset ref; when empty a soft round particle is used
tilesX?
optionaltilesX?:number
sprite-sheet grid columns (default 1) — frame advances over particle lifetime
tilesY?
optionaltilesY?:number
sprite-sheet grid rows (default 1)