Nameless Engine
Loading...
Searching...
No Matches
ne::ShaderLightArray::LightsInFrustum Struct Reference

#include <ShaderLightArray.h>

Public Attributes

std::vector< Node * > vShaderLightNodeArray
 
std::vector< unsigned int > vLightIndicesInFrustum
 
std::array< std::unique_ptr< UploadBuffer >, FrameResourcesManager::getFrameResourcesCount()> vGpuResources
 
std::string sShaderResourceName
 

Detailed Description

Groups resources related to light sources in active camera's frustum.

Member Data Documentation

◆ sShaderResourceName

std::string ne::ShaderLightArray::LightsInFrustum::sShaderResourceName

Name of the shader resource that stores indices to lights in camera's frustum.

Remarks
Empty if array of indices is not used.

◆ vGpuResources

std::array<std::unique_ptr<UploadBuffer>, FrameResourcesManager::getFrameResourcesCount()> ne::ShaderLightArray::LightsInFrustum::vGpuResources

GPU resources that store vLightIndicesInFrustum.

Remarks
Resources in this array are always valid if you specified that you need an index array for this light array (when creating shader light array object) and always have space for at least one item (even if there are no lights spawned) to avoid hitting nullptr or have branching when binding resources (when there are no active lights these resources will not be used since counter for light sources will be zero but we will have a valid binding).

◆ vLightIndicesInFrustum

std::vector<unsigned int> ne::ShaderLightArray::LightsInFrustum::vLightIndicesInFrustum

Stores indices to elements from vLightIndicesInFrustum that are located inside of active camera's frustum.

◆ vShaderLightNodeArray

std::vector<Node*> ne::ShaderLightArray::LightsInFrustum::vShaderLightNodeArray

Array of light nodes of the same type (if this shader light array object is used only for directional lights then only directional light nodes are stored in this array) where positions of light nodes in this array correspond to positions of their light data from vGpuResources. So light data at index 0 in the array used in shaders is taken from the light node stored in this array at index 0.

Remarks
For example, you can use indices of light nodes in this array to tell the shaders which lights to process in shaders and which to ignore.

The documentation for this struct was generated from the following file: