Enhanced sky atmosphere with DBC-driven colors, sun lighting, and zone weather

- Skybox now uses DBC sky colors (skyTop/skyMiddle/skyBand1/skyBand2) instead
  of hardcoded C++ color curves, with 3-band gradient and Rayleigh/Mie scattering
- Clouds receive sun direction for lit edges, self-shadowing, and silver lining
- Fixed sun quad box artifact with proper edge fade in celestial shader
- Lens flare attenuated by fog, cloud density, and weather intensity
- Replaced garish green/purple lens flare ghosts with warm natural palette
- Added zone-based weather system for single-player mode with per-zone rain/snow
  configuration, probability-based activation, and smooth intensity transitions
- Server SMSG_WEATHER remains authoritative when connected to a server
This commit is contained in:
Kelsi 2026-02-22 23:20:13 -08:00
parent 085fd09b9d
commit 6563eebb60
18 changed files with 434 additions and 252 deletions

View file

@ -4,6 +4,7 @@
#include <vk_mem_alloc.h>
#include <glm/glm.hpp>
#include <vector>
#include <unordered_map>
namespace wowee {
namespace rendering {
@ -79,6 +80,35 @@ public:
*/
int getParticleCount() const;
/**
* @brief Zone weather configuration
* Provides default weather per zone for single-player mode.
* When connected to a server, SMSG_WEATHER overrides these.
*/
struct ZoneWeather {
Type type = Type::NONE;
float minIntensity = 0.0f; // Min intensity (varies over time)
float maxIntensity = 0.0f; // Max intensity
float probability = 0.0f; // Chance of weather being active (0-1)
};
/**
* @brief Set weather for a zone (used for zone-based weather configuration)
*/
void setZoneWeather(uint32_t zoneId, Type type, float minIntensity, float maxIntensity, float probability);
/**
* @brief Update weather based on current zone (single-player mode)
* @param zoneId Current zone ID
* @param deltaTime Time since last frame
*/
void updateZoneWeather(uint32_t zoneId, float deltaTime);
/**
* @brief Initialize default zone weather table
*/
void initializeZoneWeatherDefaults();
/**
* @brief Clean up Vulkan resources
*/
@ -120,6 +150,15 @@ private:
static constexpr int MAX_PARTICLES = 2000;
static constexpr float SPAWN_VOLUME_SIZE = 100.0f; // Size of spawn area around camera
static constexpr float SPAWN_HEIGHT = 80.0f; // Height above camera to spawn
// Zone-based weather
std::unordered_map<uint32_t, ZoneWeather> zoneWeatherTable_;
uint32_t currentWeatherZone_ = 0;
float zoneWeatherTimer_ = 0.0f; // Time accumulator for weather cycling
float zoneWeatherCycleDuration_ = 0.0f; // Current cycle length
bool zoneWeatherActive_ = false; // Is zone weather currently active?
float targetIntensity_ = 0.0f; // Target intensity for smooth transitions
bool zoneWeatherInitialized_ = false;
};
} // namespace rendering