Untold Engine
Beta v0.0.16
docs
|
The U4DRenderEntity class manages all rendering for 3D models, images, skyboxes, etc. More...
Inherited by U4DEngine::U4DRender3DModel, U4DEngine::U4DRenderGeometry, U4DEngine::U4DRenderImage, U4DEngine::U4DRenderParticleSystem, U4DEngine::U4DRenderShaderEntity, U4DEngine::U4DRenderSkybox, and U4DEngine::U4DRenderWorld.
Public Member Functions | |
U4DRenderEntity () | |
Constructor for the U4DRenderEntity. More... | |
virtual | ~U4DRenderEntity () |
Destructor for the U4DRenderEntity. More... | |
void | loadRenderingInformation () |
Sends attributes information to the GPU. More... | |
virtual bool | loadMTLBuffer () |
Loads the attributes and Uniform data. More... | |
virtual void | loadMTLTexture () |
Loads image texture into GPU. More... | |
virtual void | loadMTLAdditionalInformation () |
Loads additional information for different types of entities. More... | |
virtual void | updateSpaceUniforms () |
Updates the space matrix of the entity. More... | |
virtual void | updateAllUniforms () |
virtual void | updateRenderingInformation () |
Updates the space matrix of the shadow. More... | |
virtual void | modifyRenderingInformation () |
virtual void | render (id< MTLRenderCommandEncoder > uRenderEncoder) |
Renders the current entity. More... | |
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... | |
virtual void | clearModelAttributeData () |
Clears the attribute container. More... | |
virtual void | initTextureSamplerObjectNull () |
Initializes texture sampler object to null. 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) |
U4DRenderPipelineInterface * | getPipeline (int uRenderPassKey) |
Protected Attributes | |
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 |
The U4DRenderEntity class manages all rendering for 3D models, images, skyboxes, etc.
U4DEngine::U4DRenderEntity::U4DRenderEntity | ( | ) |
Constructor for the U4DRenderEntity.
The constructor initializes the Metal device and sets the descriptors and pipeline states to NULL
|
virtual |
Destructor for the U4DRenderEntity.
Sets all descriptors and pipeline states to NULL
|
inlinevirtual |
Clears the attribute container.
clears vertices, normals, uv, tangent,materials, bone and vertex weights containers
Reimplemented in U4DEngine::U4DRender3DModel, U4DEngine::U4DRenderParticleSystem, U4DEngine::U4DRenderImage, U4DEngine::U4DRenderShaderEntity, U4DEngine::U4DRenderGeometry, U4DEngine::U4DRenderSkybox, U4DEngine::U4DRenderWorld, and U4DEngine::U4DRenderFont.
void U4DEngine::U4DRenderEntity::clearRawImageData | ( | ) |
Clear the raw image data.
Clears the decode image data used for texturing
void U4DEngine::U4DRenderEntity::createSamplerObject | ( | id< MTLSamplerState > & | uSamplerStateObject, |
MTLSamplerDescriptor * | uSamplerDescriptor | ||
) |
Creates a sampler object required for texturing.
Creates a sampler descriptor and sets the filtering and addressing settings. Loads the sampler descriptor into a newly created sampler object.
|
virtual |
Creates a texture object to be applied to an entity.
It creates a texture descriptor, and loads texture raw data into a newly created texture object
Reimplemented in U4DEngine::U4DRenderSkybox.
|
inlinevirtual |
Initializes texture sampler object to null.
It initializes the sampler object to null. The object is later used to store sampler settings
Reimplemented in U4DEngine::U4DRender3DModel, U4DEngine::U4DRenderParticleSystem, and U4DEngine::U4DRenderImage.
|
inlinevirtual |
Loads additional information for different types of entities.
Some entities requires additional information to be sent to the GPU. This methods allows for different information to be sent.
Reimplemented in U4DEngine::U4DRender3DModel, U4DEngine::U4DRenderShaderEntity, U4DEngine::U4DRenderParticleSystem, U4DEngine::U4DRenderGeometry, and U4DEngine::U4DRenderSprite.
|
inlinevirtual |
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
Reimplemented in U4DEngine::U4DRender3DModel, U4DEngine::U4DRenderParticleSystem, U4DEngine::U4DRenderImage, U4DEngine::U4DRenderShaderEntity, U4DEngine::U4DRenderSkybox, U4DEngine::U4DRenderGeometry, and U4DEngine::U4DRenderWorld.
|
inlinevirtual |
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 in U4DEngine::U4DRender3DModel, U4DEngine::U4DRenderParticleSystem, U4DEngine::U4DRenderImage, U4DEngine::U4DRenderShaderEntity, and U4DEngine::U4DRenderSkybox.
void U4DEngine::U4DRenderEntity::loadRenderingInformation | ( | ) |
Sends attributes information to the GPU.
It initializes the library and pipeline. It then loads vertices, normals, UV coordinates and animation data into the GPU
|
inlinevirtual |
Renders the current entity.
Updates the space matrix, any rendering flags, bones and shadows properties. It encodes the pipeline, buffers and issues the draw command
uRenderEncoder | Metal encoder object for the current entity |
Reimplemented in U4DEngine::U4DRender3DModel, U4DEngine::U4DRenderParticleSystem, U4DEngine::U4DRenderImage, U4DEngine::U4DRenderShaderEntity, U4DEngine::U4DRenderSkybox, U4DEngine::U4DRenderGeometry, U4DEngine::U4DRenderWorld, U4DEngine::U4DRenderSprite, and U4DEngine::U4DRenderFont.
|
inlinevirtual |
Set line color for geometric entities.
Geometric entities such as cubes, spheres etc are rendered only with lines. This method sets the particular color.
uGeometryLineColor | Vector denoting the desired color |
Reimplemented in U4DEngine::U4DRenderGeometry.
void U4DEngine::U4DRenderEntity::setIsWithinFrustum | ( | bool | uValue | ) |
Sets property used to determine if entity is within frustum.
If the property is set, the entity is rendered, else is ignored
uValue | true for is within the frustum, false if is not |
|
inlinevirtual |
Reimplemented in U4DEngine::U4DRender3DModel.
|
inlinevirtual |
Updates the space matrix of the shadow.
Updates the current shadow matrix by computing the current light space projection matrix
Reimplemented in U4DEngine::U4DRenderGeometry, and U4DEngine::U4DRenderFont.
|
inlinevirtual |
Updates the space matrix of the entity.
Updates the model space matrix of the entity by computing the world, view and perspective/orthogonal (depending on entity type) space matrix
Reimplemented in U4DEngine::U4DRender3DModel, U4DEngine::U4DRenderParticleSystem, U4DEngine::U4DRenderImage, U4DEngine::U4DRenderShaderEntity, U4DEngine::U4DRenderSkybox, U4DEngine::U4DRenderGeometry, and U4DEngine::U4DRenderWorld.