U4DEngine::U4DRenderLights class

The U4DRenderLights class manages the rendering of the light entity. Note, it wiil simply render a sphere.

Base classes

class U4DEngine::U4DRenderManager
The U4DRenderManager class manages all rendering for 3D models, images, skyboxes, etc.

Constructors, destructors, conversion operators

U4DRenderLights(U4DLights* uU4DLights)
Constructor for class.
~U4DRenderLights()
Destructor for class.

Public functions

auto getEntitySpace() -> U4DDualQuaternion virtual
Returns the absolute space of the entity.
void initMTLRenderLibrary() virtual
Initializes the library shaders.
void initMTLRenderPipeline() virtual
Initializes the Rendering Pipeline.
auto loadMTLBuffer() -> bool virtual
Loads the attributes and Uniform data.
void updateSpaceUniforms() virtual
Updates the space matrix of the entity.
void render(id<MTLRenderCommandEncoder> uRenderEncoder) virtual
Renders the current entity.
void alignedAttributeData()
Aligns the attribute data.
void clearModelAttributeData() virtual
Clears the attribute container.

Function documentation

U4DEngine::U4DRenderLights::U4DRenderLights(U4DLights* uU4DLights)

Constructor for class.

Parameters
uU4DLights light entity

It sets the light entity it will manage

U4DDualQuaternion U4DEngine::U4DRenderLights::getEntitySpace() virtual

Returns the absolute space of the entity.

Returns Returns the entity absolure space-Orientation and Position

void U4DEngine::U4DRenderLights::initMTLRenderLibrary() virtual

Initializes the library shaders.

It initializes the vertex and fragment shaders for the entity

void U4DEngine::U4DRenderLights::initMTLRenderPipeline() virtual

Initializes the Rendering Pipeline.

It prepares the rendering descriptor with the appropriate color attachment, depth attachment, shaders and attributes

bool U4DEngine::U4DRenderLights::loadMTLBuffer() virtual

Loads the attributes and Uniform data.

Returns True if loading is successful

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

void U4DEngine::U4DRenderLights::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

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

Renders the current entity.

Parameters
uRenderEncoder Metal encoder object for the current entity

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

void U4DEngine::U4DRenderLights::alignedAttributeData()

Aligns the attribute data.

aligns the vertices before sending them to the GPU

void U4DEngine::U4DRenderLights::clearModelAttributeData() virtual

Clears the attribute container.

clears vertices containers