diff --git a/src/Features/InteriorSunShadows.cpp b/src/Features/InteriorSunShadows.cpp index ea766f2756..41ea4f1c0d 100644 --- a/src/Features/InteriorSunShadows.cpp +++ b/src/Features/InteriorSunShadows.cpp @@ -46,7 +46,7 @@ void InteriorSunShadows::EarlyPrepass() inline bool InteriorSunShadows::IsInteriorWithSun(const RE::TESObjectCELL* cell) { - return cell && cell->cellFlags.all(RE::TESObjectCELL::Flag::kIsInteriorCell, RE::TESObjectCELL::Flag::kShowSky, RE::TESObjectCELL::Flag::kUseSkyLighting); + return cell && cell->cellFlags.all(RE::TESObjectCELL::Flag::kIsInteriorCell, RE::TESObjectCELL::Flag::kShowSky, RE::TESObjectCELL::Flag::kUseSkyLighting, static_cast(CellFlagExt::kSunlightShadows)); } RE::TESWorldSpace* InteriorSunShadows::GetWorldSpace::thunk(RE::TES* tes) diff --git a/src/Features/InteriorSunShadows.h b/src/Features/InteriorSunShadows.h index 9590a6b229..0139654a53 100644 --- a/src/Features/InteriorSunShadows.h +++ b/src/Features/InteriorSunShadows.h @@ -51,7 +51,14 @@ struct InteriorSunShadows : Feature } } + static bool IsInteriorWithSun(const RE::TESObjectCELL* cell); + private: + enum class CellFlagExt : uint16_t + { + kSunlightShadows = 1 << 15, + }; + float* gShadowDistance = nullptr; uint32_t* rasterStateCullMode = nullptr; @@ -69,8 +76,6 @@ struct InteriorSunShadows : Feature void InitialiseOnNewCell(const RE::NiPointer& portalGraph); - static bool IsInteriorWithSun(const RE::TESObjectCELL* cell); - bool IsInSunDirectionAndWithinShadowDistance(const RE::NiPointer& object, const RE::NiPoint3& lightDir, const RE::NiPoint3& playerPos) const; void PopulateReplacementJobArrays(RE::TESObjectCELL* cell, const RE::NiPointer& portalGraph, const RE::BSShadowDirectionalLight* dirLight, RE::BSTArray>>& jobArrays); diff --git a/src/Features/VolumetricLighting.cpp b/src/Features/VolumetricLighting.cpp index 3ca48cc947..5b1094e28d 100644 --- a/src/Features/VolumetricLighting.cpp +++ b/src/Features/VolumetricLighting.cpp @@ -1,5 +1,6 @@ #include "VolumetricLighting.h" +#include "InteriorSunShadows.h" #include "ShaderCache.h" #include "State.h" @@ -189,7 +190,7 @@ void VolumetricLighting::EarlyPrepass() initialised = true; inInterior = currentlyInInterior; - inInteriorWithSunShadows = interiorCell && interiorCell->cellFlags.all(RE::TESObjectCELL::Flag::kIsInteriorCell, RE::TESObjectCELL::Flag::kShowSky, RE::TESObjectCELL::Flag::kUseSkyLighting); + inInteriorWithSunShadows = InteriorSunShadows::IsInteriorWithSun(interiorCell); SetupVL(); }