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

Detailed Description

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

Classes

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...
struct  ParticleJobUniformData
struct  ParticleJobSliceOutputData
struct  ParticleJobContext
class  ParticleContext

Typedefs

typedef unsigned int JOB_ID
typedef Base::ParticleRenderInfoBase ParticleRenderInfo

Functions

 __ImplementContext (ParticleContext, ParticleContext::particleContextAllocator)
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 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 ParticleUpdateAge (const float stepTime, const Particle &in, Particle &out)
 update the age of one particle
void ParticleStep (const ParticleJobUniformData *perSystemUniforms, const float stepTime, const Particle &in, Particle &out, ParticleJobSliceOutputData *sliceOutput)
 integrate the particle state with a given time-step

Variables

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::AtomicCounter allSystemsCompleteCounter = 0
struct { 
   CoreGraphics::BufferId   Particles::geometryVbo 
   CoreGraphics::BufferId   Particles::geometryIbo 
   Util::FixedArray< CoreGraphics::BufferId >   Particles::vbos 
   Util::FixedArray< SizeT >   Particles::vboSizes 
   Util::FixedArray< byte * >   Particles::mappedVertices 
   byte *   Particles::vertexPtr 
   SizeT   Particles::vertexSize 
   Util::Array< CoreGraphics::VertexComponent >   Particles::particleComponents 
   CoreGraphics::VertexLayoutId   Particles::layout 
   CoreGraphics::PrimitiveGroup   Particles::primGroup 
   SizeT   Particles::numParticlesThisFrame 
state

Typedef Documentation

◆ JOB_ID

typedef unsigned int Particles::JOB_ID

◆ ParticleRenderInfo

typedef Base::ParticleRenderInfoBase Particles::ParticleRenderInfo

Function Documentation

◆ __ImplementContext()

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

◆ JobStep()

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

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

◆ 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

◆ ParticleUpdateAge()

__forceinline void Particles::ParticleUpdateAge ( const float stepTime,
const Particle & in,
Particle & out )

update the age of one particle

◆ UpdateBbox()

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

update bounding box (min, max) with vector v

Variable Documentation

◆ allSystemsCompleteCounter

Threading::AtomicCounter Particles::allSystemsCompleteCounter = 0

◆ DefaultStepTime

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

◆ geometryIbo

CoreGraphics::BufferId Particles::geometryIbo

◆ geometryVbo

CoreGraphics::BufferId Particles::geometryVbo

◆ layout

CoreGraphics::VertexLayoutId Particles::layout

◆ mappedVertices

Util::FixedArray<byte*> Particles::mappedVertices

◆ MaxNumRenderedParticles

const SizeT Particles::MaxNumRenderedParticles = 65535
static

◆ numParticlesThisFrame

SizeT Particles::numParticlesThisFrame

◆ particleComponents

Util::Array<CoreGraphics::VertexComponent> Particles::particleComponents

◆ 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

◆ ParticleSystemNumEnvelopeSamples

const SizeT Particles::ParticleSystemNumEnvelopeSamples = 192
static

number of samples in envelope curves

◆ primGroup

CoreGraphics::PrimitiveGroup Particles::primGroup

◆ [struct]

struct { ... } Particles::state

◆ StepTime

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

◆ vbos

◆ vboSizes

Util::FixedArray<SizeT> Particles::vboSizes

◆ vertexPtr

byte* Particles::vertexPtr

◆ vertexSize

SizeT Particles::vertexSize