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
5 changes: 5 additions & 0 deletions package/Shaders/ISVolumetricLightingGenerateCS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ cbuffer PerTechnique : register(b0)
float phaseContribution = lerp(1, phaseFactor, PhaseContribution);

float shadowContribution = noShadow;

# if defined(TERRAIN_SHADOWS) || defined(CLOUD_SHADOWS)
shadowContribution *= sqrt(ShadowSampling::GetWorldShadow(positionWS.xyz, PosAdjust[eyeIndex], eyeIndex));
# endif

float vl = shadowContribution * densityContribution * phaseContribution;

DensityRW[dispatchID.xyz] = vl;
Expand Down
10 changes: 0 additions & 10 deletions src/Features/SkySync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ void SkySync::PostPostLoad()
stl::detour_thunk<Moon_Update>(REL::RelocationID(25626, 26169));
stl::detour_thunk<Sky_Update>(REL::RelocationID(25682, 26229));
stl::detour_thunk<Sky_OnNewClimate>(REL::RelocationID(25695, 26242));
stl::write_thunk_call<ApplyVolumetricLighting_VolumetricLightingDescriptor_Get>(REL::RelocationID(100475, 107193).address() + 0x354);

gSunPosition = reinterpret_cast<RE::NiPoint3*>(REL::RelocationID(527924, 414871).address());
gSunGlareSize = reinterpret_cast<float*>(REL::RelocationID(502611, 370235).address());
Expand Down Expand Up @@ -415,7 +414,6 @@ void SkySync::ShadowFader::SetLighting(const RE::Sun* sun, RE::NiPoint3 dir, flo
sun->light->Update(updateData);

intensity = std::clamp(intensity, 0.0f, 1.0f);
volumetricLightingIntensityFactor = intensity;
}

inline void SkySync::ShadowFader::ClampDirection(RE::NiPoint3& dir)
Expand All @@ -436,14 +434,6 @@ inline void SkySync::ShadowFader::ClampDirection(RE::NiPoint3& dir)
dir.z = sinElev;
}

SkySync::VolumetricLightingDescriptor* SkySync::ApplyVolumetricLighting_VolumetricLightingDescriptor_Get::thunk()
{
const auto volumetricLightingDescriptor = func();
if (globals::features::skySync.settings.Enabled)
volumetricLightingDescriptor->lightingIntensity *= volumetricLightingIntensityFactor;
return volumetricLightingDescriptor;
}

void SkySync::ClimateTimings::Update(const RE::TESClimate* climate)
{
const float SunriseBeginOffset = globals::features::skySync.settings.SunriseBeginOffset;
Expand Down
13 changes: 0 additions & 13 deletions src/Features/SkySync.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,6 @@ struct SkySync : Feature
static inline REL::Relocation<decltype(thunk)> func;
};

struct VolumetricLightingDescriptor
{
float lightingIntensity;
};

struct ApplyVolumetricLighting_VolumetricLightingDescriptor_Get
{
static VolumetricLightingDescriptor* thunk();
static inline REL::Relocation<decltype(thunk)> func;
};

inline static float volumetricLightingIntensityFactor = 1.0f;

private:
enum class MoonLightSource : uint8_t
{
Expand Down
Loading