Kelsidavis-WoWee/include/pipeline/wowee_light.hpp
Kelsi d58ee0af7d feat(pipeline): add Wowee Open Light (.wol) atmosphere format
New open replacement for WoW's Light.dbc / LightParams.dbc /
LightIntBand.dbc / LightFloatBand.dbc stack — a single .wol
file holds a list of time-of-day keyframes for one zone,
each capturing the ambient + directional + fog state at that
moment. The renderer interpolates between adjacent keyframes
by time-of-day.

Binary layout:
  magic[4] = "WOLA", version (uint32),
  nameLen + name bytes,
  keyframeCount + keyframes (each 13 floats + 1 uint32 time)

Per keyframe:
  • timeOfDayMin (0..1439 = minutes since midnight)
  • ambientColor.rgb, directionalColor.rgb, directionalDir.xyz
  • fogColor.rgb, fogStart, fogEnd

CLI:
  • --gen-light <wol-base> [zoneName] — emit a starter file
    with 4-keyframe day/night cycle (midnight/dawn/noon/dusk)
    using reasonable outdoor defaults
  • --info-wol <wol-base> [--json] — inspect: zone name +
    per-keyframe time-of-day + colors + fog distances

The 7th open-format addition to the Wowee pipeline:
  M2  → WOM (model)
  WMO → WOB (building)
  WMO collision → WOC
  ADT → WOT (terrain)
  DBC → JsonDBC
  BLP → PNG
  Light.dbc family → WOL  ← new

Smoke-tested round-trip: gen → info shows correct 4 keyframes
at 00:00 / 06:00 / 12:00 / 18:00 with the canonical color
ramps. JSON output for tooling integration.
2026-05-09 13:52:07 -07:00

64 lines
2.2 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <glm/glm.hpp>
#include <cstdint>
#include <string>
#include <vector>
namespace wowee {
namespace pipeline {
// Wowee Open Light format (.wol) — novel replacement for WoW's
// Light.dbc / LightParams.dbc / LightIntBand.dbc / LightFloatBand.dbc
// stack. A WOL file holds a list of time-of-day keyframes for one
// zone, each capturing the ambient + directional + fog state at that
// moment. The renderer interpolates between adjacent keyframes by
// time-of-day.
//
// Binary layout (little-endian):
// magic[4] = "WOLA"
// version (uint32) = current 1
// nameLen (uint32)
// name bytes (nameLen)
// keyframeCount (uint32)
// keyframes (each):
// timeOfDayMin (uint32) -- 0..1439, minutes since midnight
// ambientColor.rgb (3 × float)
// directionalColor.rgb (3 × float)
// directionalDir.xyz (3 × float) -- unit vector pointing FROM
// the sun TO the surface
// fogColor.rgb (3 × float)
// fogStart (float) -- meters
// fogEnd (float) -- meters
struct WoweeLight {
struct Keyframe {
uint32_t timeOfDayMin = 0;
glm::vec3 ambientColor{0.20f, 0.20f, 0.25f};
glm::vec3 directionalColor{0.95f, 0.92f, 0.85f};
glm::vec3 directionalDir{0.0f, -1.0f, 0.0f};
glm::vec3 fogColor{0.65f, 0.70f, 0.78f};
float fogStart = 80.0f;
float fogEnd = 600.0f;
};
std::string name; // zone or scene name
std::vector<Keyframe> keyframes; // sorted by timeOfDayMin
bool isValid() const { return !keyframes.empty(); }
};
class WoweeLightLoader {
public:
static bool save(const WoweeLight& light, const std::string& basePath);
static WoweeLight load(const std::string& basePath);
static bool exists(const std::string& basePath);
// Convenience: emit a 4-keyframe day/night cycle (dawn 6:00,
// noon 12:00, dusk 18:00, midnight 0:00) with reasonable
// outdoor defaults. Used by --gen-light to create a starter
// file users can edit.
static WoweeLight makeDefaultDayNight(const std::string& zoneName);
};
} // namespace pipeline
} // namespace wowee