1#ifndef _LIGHT_MANAGER_HPP_
2#define _LIGHT_MANAGER_HPP_
77 m_ambientIntensity = intensity;
81 return m_ambientIntensity;
85 return m_lights.GetSize();
89 m_fogR = r; m_fogG = g; m_fogB = b;
92 m_fogStart = start; m_fogEnd = end;
103 m_fogZenithR = r; m_fogZenithG = g; m_fogZenithB = b;
122 float m_ambientR = 0.1f;
123 float m_ambientG = 0.1f;
124 float m_ambientB = 0.1f;
125 float m_ambientIntensity = 1.0f;
128 bool m_fogEnabled =
true;
129 float m_fogR = 0.62f, m_fogG = 0.74f, m_fogB = 0.88f;
130 float m_fogZenithR = 0.42f, m_fogZenithG = 0.58f, m_fogZenithB = 0.86f;
131 float m_fogStart = 80.0f;
132 float m_fogEnd = 256.0f;
135 bool m_heightFogEnabled =
true;
136 float m_heightFogTop = 80.0f;
137 float m_heightFogDensity = 0.55f;
138 float m_heightFogFalloff = 0.04f;
146 float m_prevLightVP[16] = {
147 1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1
149 bool m_hasPrevLightVP =
false;
float GetFogStart() const
void SetFogColor(float r, float g, float b)
size_t GetLightCount() const
void SetFogZenithColor(float r, float g, float b)
void SetAmbientIntensity(float intensity)
void SetAmbientColor(float r, float g, float b)
void SetHeightFogEnabled(bool enabled)
void SetHeightFogDensity(float d)
void SetHeightFogTop(float worldY)
float GetHeightFogTop() const
float GetHeightFogDensity() const
bool IsFogEnabled() const
void RegisterLight(Light *light)
void UpdateDeferredCB()
Refreshes the deferred-pass constant buffer (fog, ambient) independent of the per-light data.
void SetFogEnabled(bool enabled)
void SetFogDistances(float start, float end)
float GetHeightFogFalloff() const
void Initialize()
Allocates the GPU light buffer; call once before the first UpdateAndBind.
void UpdateShadowData()
Picks the active shadow-casting light and refreshes its shadow-space matrices.
float GetAmbientIntensity() const
void SetHeightFogFalloff(float f)
void UpdateAndBind()
Packs every registered light and the fog/ambient parameters into the light buffer and binds it.
void UnregisterLight(Light *light)
bool IsHeightFogEnabled() const
Implements a dynamic array-like list for storing and managing a collection of elements.
Backend-agnostic GPU buffer: vertex, index, constant, or resource view target.
Backend-facing rendering layer shared by the four graphics backends.
Root namespace for everything the engine exposes.
Full per-frame lighting UBO: camera, ambient, fog, and the packed light array.