Nebula
Loading...
Searching...
No Matches
Particles Namespace Reference

Detailed Description

Particle context controls playing and enabling/disabling of particle attrs inside a model.

A ParticleResource contains the data for a particle effect, such as attrs and meshes.

The loader for particle effects.

Classes

struct  [struct].state
class  EmitterAttrs
 A container for particle emitter attributes. More...
class  EmitterMesh
 An emitter mesh holds positions and normals for particle emission. More...
class  EnvelopeCurve
 An Attack/Sustain/Release envelope curve class with optional sine/cosine modulation. More...
class  EnvelopeSampleBuffer
 A lookup table for pre-sampled envelope curves. More...
class  Particle
 The particle structure holds the current state of a single particle and common data for particle-job and nebula3 particle system. More...
class  ParticleContext
struct  ParticleEmitters
struct  ParticleJobContext
struct  ParticleJobSliceOutputData
struct  ParticleJobUniformData
class  ParticleLoader
struct  ParticleResourceId

Typedefs

typedef unsigned int JOB_ID
typedef Base::ParticleRenderInfoBase ParticleRenderInfo
typedef Ids::IdAllocatorSafe< 0xFFFF, ParticleEmitters > ParticleResourceAllocator

Enumerations

enum  { ParticleResource_Resource }

Functions

 __ImplementContext (ParticleContext, ParticleContext::particleContextAllocator)
void JobStep (const ParticleJobUniformData *perSystemUniforms, const float stepTime, unsigned int numParticles, const Particle *particles_input, Particle *particles_output, Particle *livingParticles, ParticleJobSliceOutputData *sliceOutput)
const float * LookupEnvelopeSamples (const float sampleBuffer[ParticleSystemNumEnvelopeSamples *EmitterAttrs::NumEnvelopeAttrs], IndexT sampleIndex)
 NOTE: JobStepAndVlist does the same as JobStep, but it also generates the vertex list.
void UpdateBbox (const vec4 &v, vec4 &min, vec4 &max)
 update bounding box (min, max) with vector v
void ParticleStep (const ParticleJobUniformData *perSystemUniforms, const float stepTime, const Particle &in, Particle &out, ParticleJobSliceOutputData *sliceOutput)
 integrate the particle state with a given time-step, retursn true if input particle is valid
void JobStep (const ParticleJobUniformData *perSystemUniforms, const float stepTime, unsigned int numParticles, const Particle *particles_input, Particle *particles_output, ParticleJobSliceOutputData *sliceOutput)
 update particle system step
const ParticleEmitters & ParticleResourceGetEmitters (const ParticleResourceId id)
 Get attrs.
ParticleEmitters & ParticleResourceGetMutableEmitters (const ParticleResourceId id)

Variables

static const char * FloatAttrNames []
static const char * BoolAttrNames []
static const char * IntAttrNames []
static const char * Float4AttrNames []
static const char * EnvelopeAttrNames []
static const SizeT ParticleSystemNumEnvelopeSamples = 192
 number of samples in envelope curves
static const SizeT MaxNumRenderedParticles = 65535
static const SizeT ParticleJobInputElementSize = sizeof(Particle)
static const SizeT ParticleJobInputMaxElementsPerSlice = JobMaxSliceSize / ParticleJobInputElementSize
static const SizeT ParticleJobInputSliceSize = ParticleJobInputMaxElementsPerSlice * ParticleJobInputElementSize
const Timing::Time DefaultStepTime = 1.0f / 60.0f
Timing::Time StepTime = 1.0f / 60.0f
const SizeT ParticleContextNumEnvelopeSamples = 192
Threading::Interlocked::AtomicCounter allSystemsCompleteCounter = 0
struct  state
CoreGraphics::MeshId DefaultEmitterMesh
ParticleResourceAllocator particleResourceAllocator

Typedef Documentation

◆ JOB_ID

typedef unsigned int Particles::JOB_ID

◆ ParticleRenderInfo

typedef Base::ParticleRenderInfoBase Particles::ParticleRenderInfo

◆ ParticleResourceAllocator

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ParticleResource_Resource 

Function Documentation

◆ __ImplementContext()

Particles::__ImplementContext ( ParticleContext ,
ParticleContext::particleContextAllocator  )

◆ JobStep() [1/2]

void Particles::JobStep ( const ParticleJobUniformData * perSystemUniforms,
const float stepTime,
unsigned int numParticles,
const Particle * particles_input,
Particle * particles_output,
Particle * livingParticles,
ParticleJobSliceOutputData * sliceOutput )
extern

◆ JobStep() [2/2]

void Particles::JobStep ( const ParticleJobUniformData * perSystemUniforms,
const float stepTime,
unsigned int numParticles,
const Particle * particles_input,
Particle * particles_output,
ParticleJobSliceOutputData * sliceOutput )

update particle system step

◆ LookupEnvelopeSamples()

__forceinline const float * Particles::LookupEnvelopeSamples ( const float sampleBuffer[ParticleSystemNumEnvelopeSamples *EmitterAttrs::NumEnvelopeAttrs],
IndexT sampleIndex )

NOTE: JobStepAndVlist does the same as JobStep, but it also generates the vertex list.

It could be in one function, but then we would always have to check a boolean value for each particle. Thats bad for the SPU, since it doesnt have any branch prediction, and it would have to throw away commands and fetch new commands from the program in each iteration lookup samples at index "sampleIndex" in sample-table

◆ ParticleResourceGetEmitters()

const ParticleEmitters & Particles::ParticleResourceGetEmitters ( const ParticleResourceId id)

Get attrs.

◆ ParticleResourceGetMutableEmitters()

ParticleEmitters & Particles::ParticleResourceGetMutableEmitters ( const ParticleResourceId id)

◆ ParticleStep()

__forceinline void Particles::ParticleStep ( const ParticleJobUniformData * perSystemUniforms,
const float stepTime,
const Particle & in,
Particle & out,
ParticleJobSliceOutputData * sliceOutput )

integrate the particle state with a given time-step, retursn true if input particle is valid

◆ UpdateBbox()

__forceinline void Particles::UpdateBbox ( const vec4 & v,
vec4 & min,
vec4 & max )

update bounding box (min, max) with vector v

Variable Documentation

◆ allSystemsCompleteCounter

Threading::Interlocked::AtomicCounter Particles::allSystemsCompleteCounter = 0

◆ BoolAttrNames

const char* Particles::BoolAttrNames[]
static
Initial value:
=
{
"Looping",
"StretchToStart",
"RenderOldestFirst",
"ViewAngleFade",
"Billboard",
}

◆ DefaultEmitterMesh

CoreGraphics::MeshId Particles::DefaultEmitterMesh
extern

◆ DefaultStepTime

const Timing::Time Particles::DefaultStepTime = 1.0f / 60.0f

◆ EnvelopeAttrNames

const char* Particles::EnvelopeAttrNames[]
static
Initial value:
=
{
"Red",
"Green",
"Blue",
"Alpha",
"EmissionFrequency",
"LifeTime",
"StartVelocity",
"RotationVelocity",
"Size",
"SpreadMin",
"SpreadMax",
"AirResistance",
"VelocityFactor",
"Mass",
"TimeManipulator",
"Alignment0"
}

◆ Float4AttrNames

const char* Particles::Float4AttrNames[]
static
Initial value:
=
{
"WindDirection"
}

◆ FloatAttrNames

const char* Particles::FloatAttrNames[]
static
Initial value:
=
{
"EmissionDuration",
"ActivityDistance",
"StartRotationMin",
"StartRotationMax",
"Gravity",
"ParticleStretch",
"VelocityRandomize",
"RotationRandomize",
"SizeRandomize",
"PrecalcTime",
"StartDelay",
"TextureTile",
"PhasesPerSecond",
}

◆ IntAttrNames

const char* Particles::IntAttrNames[]
static
Initial value:
=
{
"StretchDetail",
"AnimPhases",
}

◆ MaxNumRenderedParticles

const SizeT Particles::MaxNumRenderedParticles = 65535
static

◆ ParticleContextNumEnvelopeSamples

const SizeT Particles::ParticleContextNumEnvelopeSamples = 192

◆ ParticleJobInputElementSize

const SizeT Particles::ParticleJobInputElementSize = sizeof(Particle)
static

◆ ParticleJobInputMaxElementsPerSlice

const SizeT Particles::ParticleJobInputMaxElementsPerSlice = JobMaxSliceSize / ParticleJobInputElementSize
static

◆ ParticleJobInputSliceSize

const SizeT Particles::ParticleJobInputSliceSize = ParticleJobInputMaxElementsPerSlice * ParticleJobInputElementSize
static

◆ particleResourceAllocator

ParticleResourceAllocator Particles::particleResourceAllocator

◆ ParticleSystemNumEnvelopeSamples

const SizeT Particles::ParticleSystemNumEnvelopeSamples = 192
static

number of samples in envelope curves

◆ state

◆ StepTime

Timing::Time Particles::StepTime = 1.0f / 60.0f