From 540fa00f12dcafa4b76521420f4abc7d917fb0c8 Mon Sep 17 00:00:00 2001 From: Alexei Dobrohotov Date: Mon, 27 Feb 2023 05:50:58 +0300 Subject: [PATCH] Don't use ESM4::Lighting fog power as fog density --- apps/openmw/mwworld/cell.cpp | 3 ++- components/esm4/lighting.hpp | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwworld/cell.cpp b/apps/openmw/mwworld/cell.cpp index dd91fd4758..56b7c1a49a 100644 --- a/apps/openmw/mwworld/cell.cpp +++ b/apps/openmw/mwworld/cell.cpp @@ -24,7 +24,8 @@ namespace MWWorld .mAmbiantColor = cell.mLighting.ambient, .mDirectionalColor = cell.mLighting.directional, .mFogColor = cell.mLighting.fogColor, - .mFogDensity = cell.mLighting.fogPower,} + // TODO: use ESM4::Lighting fog parameters + .mFogDensity = 1.f,} ,mWaterHeight(cell.mWaterHeight) { } diff --git a/components/esm4/lighting.hpp b/components/esm4/lighting.hpp index 4cfa8957d7..8883c71643 100644 --- a/components/esm4/lighting.hpp +++ b/components/esm4/lighting.hpp @@ -33,7 +33,8 @@ namespace ESM4 { #pragma pack(push, 1) - // guesses only for TES4 + + // FO3/FNV version of the struct struct Lighting { // | Aichan Prison values std::uint32_t ambient; // | 16 17 19 00 (RGBA) @@ -45,9 +46,10 @@ namespace ESM4 std::int32_t rotationZ; // rotation z | 00 00 00 00 = 0 float fogDirFade; // Fog dir fade | 00 00 80 3F = 1.f float fogClipDist; // Fog clip dist | 00 80 3B 45 = 3000.f - float fogPower = std::numeric_limits::max(); + float fogPower = 1.f; // TES4 doesn't have this }; + // Currently unused struct Lighting_TES5 { std::uint32_t ambient;