Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Features/InteriorSunShadows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<RE::TESObjectCELL::Flag>(CellFlagExt::kSunlightShadows));
}

RE::TESWorldSpace* InteriorSunShadows::GetWorldSpace::thunk(RE::TES* tes)
Expand Down
9 changes: 7 additions & 2 deletions src/Features/InteriorSunShadows.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -69,8 +76,6 @@ struct InteriorSunShadows : Feature

void InitialiseOnNewCell(const RE::NiPointer<RE::BSPortalGraph>& portalGraph);

static bool IsInteriorWithSun(const RE::TESObjectCELL* cell);

bool IsInSunDirectionAndWithinShadowDistance(const RE::NiPointer<RE::NiAVObject>& object, const RE::NiPoint3& lightDir, const RE::NiPoint3& playerPos) const;

void PopulateReplacementJobArrays(RE::TESObjectCELL* cell, const RE::NiPointer<RE::BSPortalGraph>& portalGraph, const RE::BSShadowDirectionalLight* dirLight, RE::BSTArray<RE::BSTArray<RE::NiPointer<RE::NiAVObject>>>& jobArrays);
Expand Down
3 changes: 2 additions & 1 deletion src/Features/VolumetricLighting.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "VolumetricLighting.h"

#include "InteriorSunShadows.h"
#include "ShaderCache.h"
#include "State.h"

Expand Down Expand Up @@ -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();
}

Expand Down