Class ParticlePool
Fixed CPU billboard pool. Technique from Banqi CaptureVfx and Sven
ParticlePool. No per-particle heap, no Box3D, no PGPSCN nodes.
public sealed class ParticlePool
- Inheritance
-
ParticlePool
- Inherited Members
Constructors
ParticlePool(int, int?)
public ParticlePool(int capacity = 384, int? seed = null)
Parameters
Fields
DefaultCapacity
public const int DefaultCapacity = 384
Field Value
Properties
ActiveCount
public int ActiveCount { get; }
Property Value
Capacity
public int Capacity { get; }
Property Value
Methods
Clear()
public void Clear()
CreateHardTexture(int)
Hard disc with ~1.5 px AA rim — for blood droplets / gib chunks that must not read as smoke (soft radial). White RGB so tint carries the color.
public static Texture2D CreateHardTexture(int size = 64)
Parameters
sizeint
Returns
- Texture2D
CreateSoftTexture()
Runtime 64² radial falloff. Games with their own sprites skip this.
public static Texture2D CreateSoftTexture()
Returns
- Texture2D
Draw(Camera3D)
public void Draw(Camera3D camera)
Parameters
cameraCamera3D
Emit(in Particle)
One fully-specified mote. Games use this for their own recipes.
public void Emit(in Particle particle)
Parameters
particleParticle
Emit(int, Vector3, in ParticleConfig)
Burst. Each mote samples config independently.
public void Emit(int count, Vector3 at, in ParticleConfig config)
Parameters
countintatVector3configParticleConfig
EmitPerSecond(ref float, float, float, Vector3, in ParticleConfig)
Rate emitter. Caller owns accumulator so many emitters
can share one pool without the pool allocating a list of rates.
public void EmitPerSecond(ref float accumulator, float dt, float perSecond, Vector3 at, in ParticleConfig config)
Parameters
accumulatorfloatdtfloatperSecondfloatatVector3configParticleConfig
RemoveTagged(byte)
Drop every mote whose Tag equals tag.
public void RemoveTagged(byte tag)
Parameters
tagbyte
Update(float)
public void Update(float dt)
Parameters
dtfloat