Integrate lighting system with renderer and shaders

Wire DBC-driven lighting to terrain shaders:
- Add LightingManager to Renderer
- Initialize lighting manager with AssetManager
- Update lighting each frame with player position
- Feed lighting params to terrain shader uniforms:
  * Ambient color
  * Diffuse (sun) color and direction
  * Fog color, start, end distances
- Fallback to skybox-based fog if lighting unavailable

TODOs for full integration:
- Wire actual map ID from game state
- Wire server game time from login packets
- Add weather/underwater state detection
- Apply lighting to WMO/M2/skybox shaders

Current state: Uses local time + Eastern Kingdoms map (0)
Next: Hook up SMSG_LOGIN_SETTIMESPEED for real game time
This commit is contained in:
Kelsi 2026-02-10 13:48:50 -08:00
parent 69fa4c6e03
commit 159a434c60
2 changed files with 40 additions and 1 deletions

View file

@ -26,6 +26,7 @@ class StarField;
class Clouds;
class LensFlare;
class Weather;
class LightingManager;
class SwimEffects;
class MountDust;
class CharacterRenderer;
@ -157,6 +158,7 @@ public:
audio::CombatSoundManager* getCombatSoundManager() { return combatSoundManager.get(); }
audio::SpellSoundManager* getSpellSoundManager() { return spellSoundManager.get(); }
audio::MovementSoundManager* getMovementSoundManager() { return movementSoundManager.get(); }
LightingManager* getLightingManager() { return lightingManager.get(); }
private:
core::Window* window = nullptr;
@ -173,6 +175,7 @@ private:
std::unique_ptr<Clouds> clouds;
std::unique_ptr<LensFlare> lensFlare;
std::unique_ptr<Weather> weather;
std::unique_ptr<LightingManager> lightingManager;
std::unique_ptr<SwimEffects> swimEffects;
std::unique_ptr<MountDust> mountDust;
std::unique_ptr<CharacterRenderer> characterRenderer;