From 9bb10f4792a7d6ee03f335ccd88125cfcb654630 Mon Sep 17 00:00:00 2001 From: Tim <15017472+doodlum@users.noreply.github.com> Date: Thu, 27 Feb 2025 15:54:47 +0000 Subject: [PATCH 1/3] chore: add landscape to skylighting --- src/Features/Skylighting.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Features/Skylighting.cpp b/src/Features/Skylighting.cpp index 8b9545338b..a19325bd41 100644 --- a/src/Features/Skylighting.cpp +++ b/src/Features/Skylighting.cpp @@ -417,7 +417,15 @@ RE::BSLightingShaderProperty::Data* Skylighting::BSLightingShaderProperty_GetPre } } - if (property->flags.any(kZBufferWrite) && property->flags.none(kRefraction, kTempRefraction, kMultiTextureLandscape, kNoLODLandBlend, kLODLandscape, kEyeReflect, kDecal, kDynamicDecal)) { + bool valid = false; + + if (skylighting->inOcclusion){ + valid = property->flags.any(kZBufferWrite) && property->flags.none(kRefraction, kTempRefraction, kLODLandscape, kEyeReflect, kDecal, kDynamicDecal); + } else { + valid = property->flags.any(kZBufferWrite) && property->flags.none(kRefraction, kTempRefraction, kMultiTextureLandscape, kNoLODLandBlend, kLODLandscape, kEyeReflect, kDecal, kDynamicDecal); + } + + if (valid) { if (geometry->worldBound.radius > 32) { stl::enumeration technique; technique.set(RenderDepth); @@ -439,7 +447,7 @@ RE::BSLightingShaderProperty::Data* Skylighting::BSLightingShaderProperty_GetPre if (property->flags.any(kTreeAnim)) { technique.set(TreeAnim); } - + precipitationOcclusionMapRenderPassList->EmplacePass( globals::game::utilityShader, property, From 7329bd8b4953b8d92f4e8023e27be90c07a06156 Mon Sep 17 00:00:00 2001 From: Tim <15017472+doodlum@users.noreply.github.com> Date: Thu, 27 Feb 2025 15:55:21 +0000 Subject: [PATCH 2/3] fix: remove skylighting bias fix --- package/Shaders/Lighting.hlsl | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/package/Shaders/Lighting.hlsl b/package/Shaders/Lighting.hlsl index 14c27cf475..141859991a 100644 --- a/package/Shaders/Lighting.hlsl +++ b/package/Shaders/Lighting.hlsl @@ -1979,16 +1979,6 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace if (dirShadow != 0.0 && (inWorld || inReflection)) dirShadow *= ShadowSampling::GetWorldShadow(input.WorldPosition, FrameBuffer::CameraPosAdjust[eyeIndex], eyeIndex); -# if defined(SKYLIGHTING) - float skylightingFadeOutFactor = 1.0; - if (!SharedData::InInterior) { - skylightingFadeOutFactor = Skylighting::getFadeOutFactor(input.WorldPosition.xyz); - // Shadow bias fix - float skylightingDirShadow = saturate(SphericalHarmonics::Unproject(skylightingSH, SharedData::DirLightDirection.xyz)); - dirShadow *= lerp(1.0, skylightingDirShadow * skylightingDirShadow, skylightingFadeOutFactor); - } -# endif - dirLightColorMultiplier *= dirShadow; float3 diffuseColor = 0.0.xxx; From d31f7393b024c2e36d334c0ed1681a2b57d46e35 Mon Sep 17 00:00:00 2001 From: doodlum Date: Thu, 27 Feb 2025 15:56:09 +0000 Subject: [PATCH 3/3] =?UTF-8?q?style:=20=F0=9F=8E=A8=20apply=20clang-forma?= =?UTF-8?q?t=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Features/Skylighting.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Features/Skylighting.cpp b/src/Features/Skylighting.cpp index a19325bd41..a8aa648361 100644 --- a/src/Features/Skylighting.cpp +++ b/src/Features/Skylighting.cpp @@ -419,7 +419,7 @@ RE::BSLightingShaderProperty::Data* Skylighting::BSLightingShaderProperty_GetPre bool valid = false; - if (skylighting->inOcclusion){ + if (skylighting->inOcclusion) { valid = property->flags.any(kZBufferWrite) && property->flags.none(kRefraction, kTempRefraction, kLODLandscape, kEyeReflect, kDecal, kDynamicDecal); } else { valid = property->flags.any(kZBufferWrite) && property->flags.none(kRefraction, kTempRefraction, kMultiTextureLandscape, kNoLODLandBlend, kLODLandscape, kEyeReflect, kDecal, kDynamicDecal); @@ -447,7 +447,7 @@ RE::BSLightingShaderProperty::Data* Skylighting::BSLightingShaderProperty_GetPre if (property->flags.any(kTreeAnim)) { technique.set(TreeAnim); } - + precipitationOcclusionMapRenderPassList->EmplacePass( globals::game::utilityShader, property,