diff --git a/include/pipeline/wowee_light.hpp b/include/pipeline/wowee_light.hpp index 91f530b5..052deb05 100644 --- a/include/pipeline/wowee_light.hpp +++ b/include/pipeline/wowee_light.hpp @@ -59,6 +59,17 @@ public: // file users can edit. static WoweeLight makeDefaultDayNight(const std::string& zoneName); + // Preset variants for non-outdoor zones — these emit a + // single-keyframe WOL since the lighting doesn't vary by + // time-of-day for an enclosed scene. + // + // makeCave dim blue ambient + heavy fog + // makeDungeon moody indoor torchlit + medium fog + // makeNight dark blue ambient + far fog (night-only zone) + static WoweeLight makeCave(const std::string& zoneName); + static WoweeLight makeDungeon(const std::string& zoneName); + static WoweeLight makeNight(const std::string& zoneName); + // Lookup the interpolated lighting state at any time-of-day // (clamped to 0..1439 minutes). Linearly blends between the // two adjacent keyframes; wraps around midnight if the query diff --git a/src/pipeline/wowee_light.cpp b/src/pipeline/wowee_light.cpp index dafb4683..5c013491 100644 --- a/src/pipeline/wowee_light.cpp +++ b/src/pipeline/wowee_light.cpp @@ -152,6 +152,52 @@ WoweeLight::Keyframe WoweeLightLoader::sampleAtTime( return out; } +WoweeLight WoweeLightLoader::makeCave(const std::string& zoneName) { + WoweeLight out; + out.name = zoneName; + // Single dim keyframe (caves don't change with time-of-day). + out.keyframes.push_back({ + 720, // noon (arbitrary) + glm::vec3(0.05f, 0.05f, 0.07f), // very dim cool ambient + glm::vec3(0.10f, 0.10f, 0.14f), // faint indirect bounce + glm::vec3(0.0f, -1.0f, 0.0f), + glm::vec3(0.04f, 0.05f, 0.07f), // near-black fog + 15.0f, 80.0f // heavy short-range fog + }); + return out; +} + +WoweeLight WoweeLightLoader::makeDungeon(const std::string& zoneName) { + WoweeLight out; + out.name = zoneName; + // Single moody warm-torchlit keyframe. + out.keyframes.push_back({ + 720, + glm::vec3(0.18f, 0.14f, 0.10f), // warm dim ambient + glm::vec3(0.55f, 0.40f, 0.25f), // amber torchlight tint + glm::vec3(0.0f, -1.0f, 0.0f), + glm::vec3(0.10f, 0.08f, 0.06f), // dark warm fog + 25.0f, 200.0f // medium fog range + }); + return out; +} + +WoweeLight WoweeLightLoader::makeNight(const std::string& zoneName) { + WoweeLight out; + out.name = zoneName; + // Single dark-night keyframe (e.g., always-night zones like + // some druid graves or shadow-realm scenes). + out.keyframes.push_back({ + 0, + glm::vec3(0.06f, 0.07f, 0.12f), // cold dim blue ambient + glm::vec3(0.18f, 0.20f, 0.32f), // moonlight-tinted directional + glm::vec3(0.30f, -0.94f, 0.0f), // moon at low angle + glm::vec3(0.05f, 0.06f, 0.10f), // near-black blue fog + 80.0f, 500.0f // far fog (open night air) + }); + return out; +} + WoweeLight WoweeLightLoader::makeDefaultDayNight( const std::string& zoneName) { WoweeLight out; diff --git a/tools/editor/cli_arg_required.cpp b/tools/editor/cli_arg_required.cpp index 3e8fa155..c307031b 100644 --- a/tools/editor/cli_arg_required.cpp +++ b/tools/editor/cli_arg_required.cpp @@ -16,6 +16,7 @@ const char* const kArgRequired[] = { "--info-mesh-storage-budget", "--info-mesh-stats", "--info-wob", "--info-wob-stats", "--info-woc", "--info-wot", "--info-wol", "--info-wol-at", "--validate-wol", "--gen-light", + "--gen-light-cave", "--gen-light-dungeon", "--gen-light-night", "--info-creatures", "--info-objects", "--info-quests", "--info-extract", "--info-extract-tree", "--info-extract-budget", "--list-missing-sidecars", diff --git a/tools/editor/cli_help.cpp b/tools/editor/cli_help.cpp index de47dd7f..7a54d6a9 100644 --- a/tools/editor/cli_help.cpp +++ b/tools/editor/cli_help.cpp @@ -783,6 +783,12 @@ void printUsage(const char* argv0) { std::printf(" Walk every keyframe; check time bounds + sort order + fogEnd > fogStart + finite color components\n"); std::printf(" --gen-light [zoneName]\n"); std::printf(" Emit a starter .wol with the canonical 4-keyframe day/night cycle (midnight + dawn + noon + dusk)\n"); + std::printf(" --gen-light-cave [zoneName]\n"); + std::printf(" Emit a single-keyframe .wol with dim cool ambient + heavy short-range fog (cave / mine interior)\n"); + std::printf(" --gen-light-dungeon [zoneName]\n"); + std::printf(" Emit a single-keyframe .wol with warm torchlit ambient + medium fog (dungeon / crypt interior)\n"); + std::printf(" --gen-light-night [zoneName]\n"); + std::printf(" Emit a single-keyframe .wol with moonlit directional + far fog (always-night zone / shadow realm)\n"); std::printf(" --info-wot [--json]\n"); std::printf(" Print WOT/WHM terrain metadata (tile, chunks, height range) and exit\n"); std::printf(" --info-extract [--json]\n"); diff --git a/tools/editor/cli_world_info.cpp b/tools/editor/cli_world_info.cpp index 75319907..fbc250ab 100644 --- a/tools/editor/cli_world_info.cpp +++ b/tools/editor/cli_world_info.cpp @@ -525,12 +525,12 @@ int handleInfoWolAt(int& i, int argc, char** argv) { return 0; } -int handleGenLight(int& i, int argc, char** argv) { - // Emit a starter .wol file with the default 4-keyframe day/ - // night cycle (midnight, dawn, noon, dusk). User can edit - // the keyframes by re-saving via a future authoring tool; - // for now this is the canonical "make me a usable atmosphere - // file in one command" entrypoint. +// Emit a .wol from a named preset. Used by all four +// --gen-light* convenience commands. +int emitLightPreset(const std::string& cmdName, + int& i, int argc, char** argv, + wowee::pipeline::WoweeLight (*maker)(const std::string&), + const char* presetDescription) { std::string base = argv[++i]; std::string zoneName = "Default"; if (i + 1 < argc && argv[i + 1][0] != '-') { @@ -539,19 +539,48 @@ int handleGenLight(int& i, int argc, char** argv) { if (base.size() >= 4 && base.substr(base.size() - 4) == ".wol") { base = base.substr(0, base.size() - 4); } - auto wol = wowee::pipeline::WoweeLightLoader::makeDefaultDayNight(zoneName); + auto wol = maker(zoneName); if (!wowee::pipeline::WoweeLightLoader::save(wol, base)) { - std::fprintf(stderr, "gen-light: failed to save %s.wol\n", - base.c_str()); + std::fprintf(stderr, "%s: failed to save %s.wol\n", + cmdName.c_str(), base.c_str()); return 1; } std::printf("Wrote %s.wol\n", base.c_str()); std::printf(" zone : %s\n", zoneName.c_str()); - std::printf(" keyframes : %zu (midnight + dawn + noon + dusk)\n", - wol.keyframes.size()); + std::printf(" preset : %s (%zu keyframe%s)\n", + presetDescription, wol.keyframes.size(), + wol.keyframes.size() == 1 ? "" : "s"); return 0; } +int handleGenLight(int& i, int argc, char** argv) { + return emitLightPreset( + "gen-light", i, argc, argv, + wowee::pipeline::WoweeLightLoader::makeDefaultDayNight, + "midnight + dawn + noon + dusk"); +} + +int handleGenLightCave(int& i, int argc, char** argv) { + return emitLightPreset( + "gen-light-cave", i, argc, argv, + wowee::pipeline::WoweeLightLoader::makeCave, + "dim cool ambient + heavy short-range fog"); +} + +int handleGenLightDungeon(int& i, int argc, char** argv) { + return emitLightPreset( + "gen-light-dungeon", i, argc, argv, + wowee::pipeline::WoweeLightLoader::makeDungeon, + "warm torchlit ambient + medium fog"); +} + +int handleGenLightNight(int& i, int argc, char** argv) { + return emitLightPreset( + "gen-light-night", i, argc, argv, + wowee::pipeline::WoweeLightLoader::makeNight, + "moonlit directional + far fog"); +} + } // namespace bool handleWorldInfo(int& i, int argc, char** argv, int& outRc) { @@ -579,6 +608,15 @@ bool handleWorldInfo(int& i, int argc, char** argv, int& outRc) { if (std::strcmp(argv[i], "--gen-light") == 0 && i + 1 < argc) { outRc = handleGenLight(i, argc, argv); return true; } + if (std::strcmp(argv[i], "--gen-light-cave") == 0 && i + 1 < argc) { + outRc = handleGenLightCave(i, argc, argv); return true; + } + if (std::strcmp(argv[i], "--gen-light-dungeon") == 0 && i + 1 < argc) { + outRc = handleGenLightDungeon(i, argc, argv); return true; + } + if (std::strcmp(argv[i], "--gen-light-night") == 0 && i + 1 < argc) { + outRc = handleGenLightNight(i, argc, argv); return true; + } return false; }