![]() |
Divide Framework 0.1
A free and open-source 3D Framework under heavy development
|
#include <LightPool.h>
Classes | |
struct | CSMShadowProperties |
struct | LightProperties |
struct | MovingVolume |
struct | PointShadowProperties |
struct | SceneData |
struct | ShadowLightList |
struct | ShadowProperties |
struct | SpotShadowProperties |
Public Types | |
using | LightList = eastl::fixed_vector< Light *, 32u, true > |
Public Member Functions | |
LightPool (Scene &parentScene, PlatformContext &context) | |
~LightPool () override | |
bool | addLight (Light &light) |
Add a new light to the manager. | |
bool | removeLight (const Light &light) |
remove a light from the manager | |
void | toggleLightType (const LightType type) noexcept |
disable or enable a specific light type | |
void | toggleLightType (const LightType type, const bool state) noexcept |
bool | lightTypeEnabled (const LightType type) const noexcept |
U32 | getActiveLightCount (const RenderStage stage, const LightType type) const noexcept |
Retrieve the number of active lights in the scene;. | |
bool | clear () noexcept |
LightList & | getLights (const LightType type) |
Light * | getLight (I64 lightGUID, LightType type) const |
void | sortLightData (RenderStage stage, const CameraSnapshot &cameraSnapshot) |
void | uploadLightData (RenderStage stage, const CameraSnapshot &cameraSnapshot, GFX::MemoryBarrierCommand &memCmdInOut) |
void | drawLightImpostors (GFX::CommandBuffer &bufferInOut) const |
void | preRenderAllPasses (const Camera *playerCamera) |
void | onVolumeMoved (const BoundingSphere &volume, bool staticSource) |
void | debugLight (Light *light) |
nullptr = disabled | |
PROPERTY_RW (bool, lightImpostorsEnabled, false) | |
POINTER_R (Light, debugLight, nullptr) | |
![]() | |
FrameListener (const Str< 64 > &name, FrameListenerManager &parent, U32 callOrder) | |
Either give it a name. | |
virtual | ~FrameListener () override |
bool | operator< (FrameListener &that) const noexcept |
![]() | |
GUIDWrapper () noexcept | |
GUIDWrapper (const GUIDWrapper &old) noexcept | |
GUIDWrapper (GUIDWrapper &&old) noexcept | |
virtual | ~GUIDWrapper ()=default |
FORCE_INLINE I64 | getGUID () const noexcept |
GUIDWrapper & | operator= (const GUIDWrapper &old)=delete |
GUIDWrapper & | operator= (GUIDWrapper &&other)=delete |
![]() | |
SceneComponent (Scene &parentScene) noexcept | |
Scene & | parentScene () noexcept |
const Scene & | parentScene () const noexcept |
![]() | |
PlatformContextComponent (PlatformContext &context) noexcept | |
virtual | ~PlatformContextComponent ()=default |
PlatformContext & | context () noexcept |
const PlatformContext & | context () const noexcept |
![]() | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
NonCopyable (NonCopyable &&)=default | |
NonCopyable & | operator= (NonCopyable &&)=default |
Static Public Member Functions | |
static void | InitStaticData (PlatformContext &context) |
static void | DestroyStaticData () |
static U8 | GetShadowBindSlotOffset (const ShadowType type) noexcept |
Get the appropriate shadow bind slot for every light's shadow. | |
![]() | |
static I64 | generateGUID () noexcept |
Protected Types | |
using | LightShadowProperties = std::array< Light::ShadowProperties, Config::Lighting::MAX_SHADOW_CASTING_LIGHTS > |
Protected Member Functions | |
bool | frameStarted (const FrameEvent &evt) override |
bool | frameEnded (const FrameEvent &evt) override |
frameEnded is called after the buffers have been swapped | |
void | generateShadowMaps (const Camera &playerCamera, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut) |
LightList::const_iterator | findLight (const I64 GUID, const LightType type) const |
LightList::const_iterator | findLightLocked (const I64 GUID, const LightType type) const |
bool | isShadowCacheInvalidated (const vec3< F32 > &cameraPosition, Light *light) |
U32 | sortedLightCount (const RenderStage stage) const |
![]() | |
void | setCallOrder (const U32 order) noexcept |
virtual bool | frameStarted (const FrameEvent &evt) |
virtual bool | framePreRender (const FrameEvent &evt) |
framePreRenderStarted is called when we need to start processing the visual aspect of a scene | |
virtual bool | frameSceneRenderStarted (const FrameEvent &evt) |
frameSceneRenderStarted is called right before rendering the scene for the current player starts | |
virtual bool | frameSceneRenderEnded (const FrameEvent &evt) |
frameSceneRenderEnded is called immediately after scene rendering for the current player has ended but before any blitting operations | |
virtual bool | frameRenderingQueued (const FrameEvent &evt) |
virtual bool | framePostRender (const FrameEvent &evt) |
virtual bool | frameEnded (const FrameEvent &evt) |
frameEnded is called after the buffers have been swapped | |
PROPERTY_R_IW (bool, enabled, false) | |
PROPERTY_RW (Str< 64 >, name) | |
![]() | |
NonCopyable ()=default | |
~NonCopyable ()=default | |
Static Protected Member Functions | |
static bool | IsLightInViewFrustum (const Frustum &frustum, const Light *light) noexcept |
static ShaderBuffer * | ShadowBuffer () |
static ShaderBuffer * | LightBuffer () |
static ShaderBuffer * | SceneBuffer () |
Private Types | |
using | LightData = std::array< LightProperties, Config::Lighting::MAX_ACTIVE_LIGHTS_PER_FRAME > |
using | LightCountPerType = std::array< U32, to_base(LightType::COUNT)> |
Private Member Functions | |
U32 | uploadLightList (RenderStage stage, const LightList &lights, const mat4< F32 > &viewMatrix) |
Private Attributes | |
std::array< LightCountPerType, to_base(RenderStage::COUNT)> | _activeLightCount {} |
std::array< LightList, to_base(RenderStage::COUNT)> | _sortedLights {} |
std::array< LightData, to_base(RenderStage::COUNT)> | _sortedLightProperties {} |
std::array< U32, to_base(RenderStage::COUNT)> | _sortedLightPropertiesCount {} |
std::array< SceneData, to_base(RenderStage::COUNT)> | _sortedSceneProperties {} |
std::array< LightList, to_base(LightType::COUNT)> | _lights {} |
std::array< bool, to_base(LightType::COUNT)> | _lightTypeState {} |
ShadowProperties | _shadowBufferData |
SharedMutex | _movedSceneVolumesLock |
eastl::fixed_vector< MovingVolume, Config::MAX_VISIBLE_NODES, true > | _movedSceneVolumes |
SharedMutex | _lightLock {} |
Time::ProfileTimer & | _shadowPassTimer |
U32 | _totalLightCount = 0u |
bool | _shadowBufferDirty = false |
Static Private Attributes | |
static std::array< U8, to_base(ShadowType::COUNT)> | s_shadowLocation |
static Handle< Texture > | s_lightIconsTexture = INVALID_HANDLE<Texture> |
static Handle< ShaderProgram > | s_lightImpostorShader = INVALID_HANDLE<ShaderProgram> |
static ShaderBuffer_uptr | s_lightBuffer = nullptr |
static ShaderBuffer_uptr | s_sceneBuffer = nullptr |
static ShaderBuffer_uptr | s_shadowBuffer = nullptr |
Friends | |
class | RenderPass |
class | ProjectManager |
class | ShadowMap |
class | Renderer |
Additional Inherited Members | |
![]() | |
const I64 | _guid |
![]() | |
Scene & | _parentScene |
![]() | |
PlatformContext & | _context |
Definition at line 57 of file LightPool.h.
|
private |
Definition at line 217 of file LightPool.h.
|
private |
Definition at line 215 of file LightPool.h.
using Divide::LightPool::LightList = eastl::fixed_vector<Light*, 32u, true> |
Definition at line 115 of file LightPool.h.
|
protected |
Definition at line 168 of file LightPool.h.
|
explicit |
Definition at line 131 of file LightPool.cpp.
|
override |
Definition at line 146 of file LightPool.cpp.
bool Divide::LightPool::addLight | ( | Light & | light | ) |
Add a new light to the manager.
Definition at line 182 of file LightPool.cpp.
|
noexcept |
Definition at line 161 of file LightPool.cpp.
void Divide::LightPool::debugLight | ( | Light * | light | ) |
nullptr = disabled
Definition at line 355 of file LightPool.cpp.
|
static |
Definition at line 121 of file LightPool.cpp.
void Divide::LightPool::drawLightImpostors | ( | GFX::CommandBuffer & | bufferInOut | ) | const |
Definition at line 574 of file LightPool.cpp.
|
inlineprotected |
Definition at line 174 of file LightPool.h.
|
inlineprotected |
Definition at line 179 of file LightPool.h.
|
overrideprotectedvirtual |
frameEnded is called after the buffers have been swapped
Reimplemented from Divide::FrameListener.
Definition at line 173 of file LightPool.cpp.
|
overrideprotectedvirtual |
Adapter patern instead of pure interface for the same reason as the Ogre boys pointed out: Implement what you need without filling classes with dummy functions frameStarted is calld at the beggining of a new frame before processing the logic aspect of a scene
Reimplemented from Divide::FrameListener.
Definition at line 166 of file LightPool.cpp.
|
protected |
Definition at line 229 of file LightPool.cpp.
|
inlinenoexcept |
Retrieve the number of active lights in the scene;.
Definition at line 133 of file LightPool.h.
Definition at line 361 of file LightPool.cpp.
Definition at line 136 of file LightPool.h.
|
inlinestaticnoexcept |
Get the appropriate shadow bind slot for every light's shadow.
Definition at line 156 of file LightPool.h.
|
static |
|
staticprotectednoexcept |
Definition at line 49 of file LightPool.cpp.
|
protected |
Definition at line 502 of file LightPool.cpp.
|
inlinestaticprotected |
Definition at line 196 of file LightPool.h.
|
inlinenoexcept |
Definition at line 131 of file LightPool.h.
void Divide::LightPool::onVolumeMoved | ( | const BoundingSphere & | volume, |
bool | staticSource | ||
) |
Definition at line 220 of file LightPool.cpp.
Divide::LightPool::POINTER_R | ( | Light | , |
debugLight | , | ||
nullptr | |||
) |
void Divide::LightPool::preRenderAllPasses | ( | const Camera * | playerCamera | ) |
Definition at line 537 of file LightPool.cpp.
Divide::LightPool::PROPERTY_RW | ( | bool | , |
lightImpostorsEnabled | , | ||
false | |||
) |
bool Divide::LightPool::removeLight | ( | const Light & | light | ) |
remove a light from the manager
Definition at line 203 of file LightPool.cpp.
|
inlinestaticprotected |
Definition at line 197 of file LightPool.h.
|
inlinestaticprotected |
Definition at line 193 of file LightPool.h.
|
inlineprotected |
Definition at line 199 of file LightPool.h.
void Divide::LightPool::sortLightData | ( | RenderStage | stage, |
const CameraSnapshot & | cameraSnapshot | ||
) |
Definition at line 423 of file LightPool.cpp.
|
inlinenoexcept |
disable or enable a specific light type
Definition at line 128 of file LightPool.h.
|
inlinenoexcept |
Definition at line 129 of file LightPool.h.
void Divide::LightPool::uploadLightData | ( | RenderStage | stage, |
const CameraSnapshot & | cameraSnapshot, | ||
GFX::MemoryBarrierCommand & | memCmdInOut | ||
) |
Definition at line 465 of file LightPool.cpp.
|
private |
Definition at line 375 of file LightPool.cpp.
|
friend |
Definition at line 173 of file LightPool.h.
|
friend |
Definition at line 195 of file LightPool.h.
|
friend |
Definition at line 170 of file LightPool.h.
|
friend |
Definition at line 192 of file LightPool.h.
|
private |
Definition at line 219 of file LightPool.h.
|
mutableprivate |
Definition at line 232 of file LightPool.h.
|
private |
Definition at line 225 of file LightPool.h.
|
private |
Definition at line 226 of file LightPool.h.
|
private |
Definition at line 230 of file LightPool.h.
|
mutableprivate |
Definition at line 229 of file LightPool.h.
|
private |
Definition at line 227 of file LightPool.h.
|
private |
Definition at line 235 of file LightPool.h.
|
private |
Definition at line 233 of file LightPool.h.
|
private |
Definition at line 221 of file LightPool.h.
|
private |
Definition at line 222 of file LightPool.h.
|
private |
Definition at line 220 of file LightPool.h.
|
private |
Definition at line 223 of file LightPool.h.
|
private |
Definition at line 234 of file LightPool.h.
|
staticprivate |
Definition at line 240 of file LightPool.h.
|
staticprivate |
Definition at line 238 of file LightPool.h.
|
staticprivate |
Definition at line 239 of file LightPool.h.
|
staticprivate |
Definition at line 241 of file LightPool.h.
|
staticprivate |
Definition at line 242 of file LightPool.h.
|
staticprivate |
Definition at line 237 of file LightPool.h.