Untold Engine  Beta v0.0.16
docs
U4DEngine::U4DRenderParticleSystem Class Reference

The U4DRenderParticleSystem class manages the rendering of particles used in the particle system. More...

Inherits U4DEngine::U4DRenderEntity.

Public Member Functions

 U4DRenderParticleSystem (U4DParticleSystem *uU4DParticleSystem)
 Constructor for class. More...
 
 ~U4DRenderParticleSystem ()
 Destructor for class. More...
 
bool loadMTLBuffer ()
 Loads the attributes and Uniform data. More...
 
void loadMTLTexture ()
 Loads image texture into GPU. More...
 
void loadMTLAdditionalInformation ()
 Loads additional information for the particle system. More...
 
void loadParticlePropertiesInformation ()
 Loads particle properties. More...
 
void loadParticleSystemPropertiesInformation ()
 Loads particle system properties. More...
 
void updateSpaceUniforms ()
 Updates the space matrix of the entity. More...
 
void updateParticlePropertiesInformation ()
 Updates the particle properties. More...
 
void render (id< MTLRenderCommandEncoder > uRenderEncoder)
 Renders the current entity. More...
 
void alignedAttributeData ()
 Aligns the attribute data. More...
 
void clearModelAttributeData ()
 Clears the attribute container. More...
 
void initTextureSamplerObjectNull ()
 Set texture sampler to NULL. More...
 
- Public Member Functions inherited from U4DEngine::U4DRenderEntity
 U4DRenderEntity ()
 Constructor for the U4DRenderEntity. More...
 
virtual ~U4DRenderEntity ()
 Destructor for the U4DRenderEntity. More...
 
void loadRenderingInformation ()
 Sends attributes information to the GPU. More...
 
virtual void updateAllUniforms ()
 
virtual void updateRenderingInformation ()
 Updates the space matrix of the shadow. More...
 
virtual void modifyRenderingInformation ()
 
virtual void createTextureObject (id< MTLTexture > &uTextureObject)
 Creates a texture object to be applied to an entity. More...
 
void createSamplerObject (id< MTLSamplerState > &uSamplerStateObject, MTLSamplerDescriptor *uSamplerDescriptor)
 Creates a sampler object required for texturing. More...
 
virtual void setGeometryLineColor (U4DVector4n &uGeometryLineColor)
 Set line color for geometric entities. More...
 
void clearRawImageData ()
 Clear the raw image data. More...
 
void setIsWithinFrustum (bool uValue)
 Sets property used to determine if entity is within frustum. More...
 
void setRawImageData (std::vector< unsigned char > uRawImageData)
 
void setImageWidth (unsigned int uImageWidth)
 
void setImageHeight (unsigned int uImageHeight)
 
bool createTextureAndSamplerObjects (id< MTLTexture > &uTextureObject, id< MTLSamplerState > &uSamplerStateObject, MTLSamplerDescriptor *uSamplerDescriptor, std::string uTextureName)
 
void setPipelineForPass (std::string uPipelineName, int uRenderPassKey)
 
void removePassPipelinePair (int uRenderPassKey)
 
U4DRenderPipelineInterfacegetPipeline (int uRenderPassKey)
 

Additional Inherited Members

- Protected Attributes inherited from U4DEngine::U4DRenderEntity
id< MTLDevice > mtlDevice
 Pointer representing a Metal Device.
 
id< MTLBuffer > attributeBuffer
 Pointer to the attribute buffer.
 
id< MTLBuffer > indicesBuffer
 Pointer to the index buffer.
 
id< MTLBuffer > uniformSpaceBuffer
 Pointer to the Uniform that holds the Space matrix.
 
bool eligibleToRender
 Variable to determine if object should be rendered.
 
bool isWithinFrustum
 Variable to determine if the 3D object is within the frustum.
 
std::vector< unsigned char > rawImageData
 buffer for the raw image data of a texture
 
unsigned int imageWidth
 Width of the texture image.
 
unsigned int imageHeight
 Height of the texture image.
 
std::map< int, U4DRenderPipelineInterface * > renderPassPipelineMap
 

Detailed Description

The U4DRenderParticleSystem class manages the rendering of particles used in the particle system.

Constructor & Destructor Documentation

◆ U4DRenderParticleSystem()

U4DEngine::U4DRenderParticleSystem::U4DRenderParticleSystem ( U4DParticleSystem uU4DParticleSystem)

Constructor for class.

sets the particle system entity the class will manage

Parameters
uU4DParticleSystemParticle system entity

◆ ~U4DRenderParticleSystem()

U4DEngine::U4DRenderParticleSystem::~U4DRenderParticleSystem ( )

Destructor for class.

releases the null sampler descriptor

Member Function Documentation

◆ alignedAttributeData()

void U4DEngine::U4DRenderParticleSystem::alignedAttributeData ( )

Aligns the attribute data.

Aligns the vertices and uv data. This is necessary to render in Metal

◆ clearModelAttributeData()

void U4DEngine::U4DRenderParticleSystem::clearModelAttributeData ( )
virtual

Clears the attribute container.

clears vertices and uv containers

Reimplemented from U4DEngine::U4DRenderEntity.

◆ initTextureSamplerObjectNull()

void U4DEngine::U4DRenderParticleSystem::initTextureSamplerObjectNull ( )
virtual

Set texture sampler to NULL.

Creates a texture and sampler object and initializes to NULL

Reimplemented from U4DEngine::U4DRenderEntity.

◆ loadMTLAdditionalInformation()

void U4DEngine::U4DRenderParticleSystem::loadMTLAdditionalInformation ( )
virtual

Loads additional information for the particle system.

Loads additional particle system properties

Reimplemented from U4DEngine::U4DRenderEntity.

◆ loadMTLBuffer()

bool U4DEngine::U4DRenderParticleSystem::loadMTLBuffer ( )
virtual

Loads the attributes and Uniform data.

It prepares the attribute data so that it is aligned. It then loads the attributes into a buffer. It also loads uniform data into a buffer

Returns
True if loading is successful

Reimplemented from U4DEngine::U4DRenderEntity.

◆ loadMTLTexture()

void U4DEngine::U4DRenderParticleSystem::loadMTLTexture ( )
virtual

Loads image texture into GPU.

It decodes the current texture image, creates a texture object, a texture sampler, and loads the raw data into a buffer

Reimplemented from U4DEngine::U4DRenderEntity.

◆ loadParticlePropertiesInformation()

void U4DEngine::U4DRenderParticleSystem::loadParticlePropertiesInformation ( )

Loads particle properties.

Loads the max number of particles to render

◆ loadParticleSystemPropertiesInformation()

void U4DEngine::U4DRenderParticleSystem::loadParticleSystemPropertiesInformation ( )

Loads particle system properties.

Loads properties used by the particle system such as textures to use, noise, etc

◆ render()

void U4DEngine::U4DRenderParticleSystem::render ( id< MTLRenderCommandEncoder >  uRenderEncoder)
virtual

Renders the current entity.

Updates the space matrix and any rendering flags. It encodes the pipeline, buffers and issues the draw command

Parameters
uRenderEncoderMetal encoder object for the current entity

Reimplemented from U4DEngine::U4DRenderEntity.

◆ updateParticlePropertiesInformation()

void U4DEngine::U4DRenderParticleSystem::updateParticlePropertiesInformation ( )

Updates the particle properties.

Updates the color of the particles

◆ updateSpaceUniforms()

void U4DEngine::U4DRenderParticleSystem::updateSpaceUniforms ( )
virtual

Updates the space matrix of the entity.

Updates the model space matrix of the entity by computing the world, view and perspective space matrix

Reimplemented from U4DEngine::U4DRenderEntity.