Nameless Engine
Loading...
Searching...
No Matches
ne::ShaderLightsInFrustumSingleType Struct Reference

#include <ShaderLightsInFrustumSingleType.hpp>

Public Attributes

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

Detailed Description

Groups resources related to light sources of the same type (point/spot/directional) in active camera's frustum and has info about which shader resource is used for these light sources.

Member Data Documentation

◆ sShaderResourceName

std::string ne::ShaderLightsInFrustumSingleType::sShaderResourceName

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

Remarks
Empty if array of indices is not used (empty for directional lights).

◆ vGpuResources

std::array<std::unique_ptr<UploadBuffer>, FrameResourceManager::getFrameResourceCount()> ne::ShaderLightsInFrustumSingleType::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::ShaderLightsInFrustumSingleType::vLightIndicesInFrustum

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

◆ vShaderLightNodeArray

std::vector<Node*> ne::ShaderLightsInFrustumSingleType::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: