From 82be5fbc995e00376e698a71980f0d64d0b3556c Mon Sep 17 00:00:00 2001 From: Dlizzio <77717521+Dlizzio@users.noreply.github.com> Date: Wed, 11 Mar 2026 00:23:47 -0700 Subject: [PATCH 1/4] init --- src/Features/SkySync.cpp | 10 ---------- src/Features/SkySync.h | 13 ------------- 2 files changed, 23 deletions(-) diff --git a/src/Features/SkySync.cpp b/src/Features/SkySync.cpp index efacb64273..30415f36bb 100644 --- a/src/Features/SkySync.cpp +++ b/src/Features/SkySync.cpp @@ -85,7 +85,6 @@ void SkySync::PostPostLoad() stl::detour_thunk(REL::RelocationID(25626, 26169)); stl::detour_thunk(REL::RelocationID(25682, 26229)); stl::detour_thunk(REL::RelocationID(25695, 26242)); - stl::write_thunk_call(REL::RelocationID(100475, 107193).address() + 0x354); gSunPosition = reinterpret_cast(REL::RelocationID(527924, 414871).address()); gSunGlareSize = reinterpret_cast(REL::RelocationID(502611, 370235).address()); @@ -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) @@ -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; diff --git a/src/Features/SkySync.h b/src/Features/SkySync.h index f8e355b076..941d5667f4 100644 --- a/src/Features/SkySync.h +++ b/src/Features/SkySync.h @@ -69,19 +69,6 @@ struct SkySync : Feature static inline REL::Relocation func; }; - struct VolumetricLightingDescriptor - { - float lightingIntensity; - }; - - struct ApplyVolumetricLighting_VolumetricLightingDescriptor_Get - { - static VolumetricLightingDescriptor* thunk(); - static inline REL::Relocation func; - }; - - inline static float volumetricLightingIntensityFactor = 1.0f; - private: enum class MoonLightSource : uint8_t { From 9ba2327b30714160e2fe933b7cd2ea28d9d85a59 Mon Sep 17 00:00:00 2001 From: Dlizzio <77717521+Dlizzio@users.noreply.github.com> Date: Wed, 11 Mar 2026 00:48:24 -0700 Subject: [PATCH 2/4] VL with terrain shadows and cloud shadows --- package/Shaders/ISVolumetricLightingGenerateCS.hlsl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/package/Shaders/ISVolumetricLightingGenerateCS.hlsl b/package/Shaders/ISVolumetricLightingGenerateCS.hlsl index 93a47e5b4f..d3e89577a2 100644 --- a/package/Shaders/ISVolumetricLightingGenerateCS.hlsl +++ b/package/Shaders/ISVolumetricLightingGenerateCS.hlsl @@ -113,6 +113,17 @@ cbuffer PerTechnique : register(b0) float phaseContribution = lerp(1, phaseFactor, PhaseContribution); float shadowContribution = noShadow; + +# if defined(TERRAIN_SHADOWS) + if (!SharedData::InInterior) + shadowContribution *= TerrainShadows::GetTerrainShadow(positionWS.xyz + PosAdjust[eyeIndex], LinearSampler); +# endif + +# if defined(CLOUD_SHADOWS) + if (!SharedData::InInterior) + shadowContribution *= sqrt(CloudShadows::GetCloudShadowMult(positionWS.xyz + PosAdjust[eyeIndex], LinearSampler)); +# endif + float vl = shadowContribution * densityContribution * phaseContribution; DensityRW[dispatchID.xyz] = vl; From f30d33853d4e6031b689c3ac1e5888264a329f4e Mon Sep 17 00:00:00 2001 From: Dlizzio <77717521+Dlizzio@users.noreply.github.com> Date: Wed, 11 Mar 2026 00:57:19 -0700 Subject: [PATCH 3/4] consolidation --- .../ISVolumetricLightingGenerateCS.hlsl | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/package/Shaders/ISVolumetricLightingGenerateCS.hlsl b/package/Shaders/ISVolumetricLightingGenerateCS.hlsl index d3e89577a2..72c7ff6764 100644 --- a/package/Shaders/ISVolumetricLightingGenerateCS.hlsl +++ b/package/Shaders/ISVolumetricLightingGenerateCS.hlsl @@ -114,14 +114,16 @@ cbuffer PerTechnique : register(b0) float shadowContribution = noShadow; -# if defined(TERRAIN_SHADOWS) - if (!SharedData::InInterior) - shadowContribution *= TerrainShadows::GetTerrainShadow(positionWS.xyz + PosAdjust[eyeIndex], LinearSampler); -# endif - -# if defined(CLOUD_SHADOWS) - if (!SharedData::InInterior) - shadowContribution *= sqrt(CloudShadows::GetCloudShadowMult(positionWS.xyz + PosAdjust[eyeIndex], LinearSampler)); +# if defined(TERRAIN_SHADOWS) || defined(CLOUD_SHADOWS) + if (!SharedData::InInterior) { + float3 worldPos = positionWS.xyz + PosAdjust[eyeIndex]; +# if defined(TERRAIN_SHADOWS) + shadowContribution *= TerrainShadows::GetTerrainShadow(worldPos, LinearSampler); +# endif +# if defined(CLOUD_SHADOWS) + shadowContribution *= sqrt(CloudShadows::GetCloudShadowMult(worldPos, LinearSampler)); +# endif + } # endif float vl = shadowContribution * densityContribution * phaseContribution; From 89cbea866aef87d1bb151c3120494d5072494a98 Mon Sep 17 00:00:00 2001 From: Dlizzio <77717521+Dlizzio@users.noreply.github.com> Date: Mon, 16 Mar 2026 18:03:46 -0700 Subject: [PATCH 4/4] GetWorldShadow --- package/Shaders/ISVolumetricLightingGenerateCS.hlsl | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/package/Shaders/ISVolumetricLightingGenerateCS.hlsl b/package/Shaders/ISVolumetricLightingGenerateCS.hlsl index 72c7ff6764..7053aedfee 100644 --- a/package/Shaders/ISVolumetricLightingGenerateCS.hlsl +++ b/package/Shaders/ISVolumetricLightingGenerateCS.hlsl @@ -115,15 +115,7 @@ cbuffer PerTechnique : register(b0) float shadowContribution = noShadow; # if defined(TERRAIN_SHADOWS) || defined(CLOUD_SHADOWS) - if (!SharedData::InInterior) { - float3 worldPos = positionWS.xyz + PosAdjust[eyeIndex]; -# if defined(TERRAIN_SHADOWS) - shadowContribution *= TerrainShadows::GetTerrainShadow(worldPos, LinearSampler); -# endif -# if defined(CLOUD_SHADOWS) - shadowContribution *= sqrt(CloudShadows::GetCloudShadowMult(worldPos, LinearSampler)); -# endif - } + shadowContribution *= sqrt(ShadowSampling::GetWorldShadow(positionWS.xyz, PosAdjust[eyeIndex], eyeIndex)); # endif float vl = shadowContribution * densityContribution * phaseContribution;