From 5321a467c5510077f392a16e96cbfeec29a90e91 Mon Sep 17 00:00:00 2001 From: BlueRose <378100977@qq.com> Date: Thu, 13 Feb 2025 12:06:27 +0800 Subject: [PATCH] vault backup: 2025-02-13 12:06:27 --- .../Rendering/RenderingPipeline/Lighting/Lighting.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/03-UnrealEngine/Rendering/RenderingPipeline/Lighting/Lighting.md b/03-UnrealEngine/Rendering/RenderingPipeline/Lighting/Lighting.md index ad5ad31..f635bbe 100644 --- a/03-UnrealEngine/Rendering/RenderingPipeline/Lighting/Lighting.md +++ b/03-UnrealEngine/Rendering/RenderingPipeline/Lighting/Lighting.md @@ -650,6 +650,7 @@ void GetShadowTerms(float SceneDepth, half4 PrecomputedShadowFactors, uint Shadi BRANCH if (LightData.ShadowedBits) { + // 重新映射ShadowProjection结果 // Remapping the light attenuation buffer (see ShadowRendering.cpp) // LightAttenuation: Light function + per-object shadows in z, per-object SSS shadowing in w, @@ -662,16 +663,16 @@ void GetShadowTerms(float SceneDepth, half4 PrecomputedShadowFactors, uint Shadi half StaticShadowing = 1.0f; #endif - if (LightData.bRadialLight || SHADING_PATH_MOBILE) + if (LightData.bRadialLight || SHADING_PATH_MOBILE)//一般是 PointLight or SpotLight。径向衰减(radial attenuation):指光照强度随距离光源的远近而衰减的特性(通常遵循平方反比定律)。 { // Remapping the light attenuation buffer (see ShadowRendering.cpp) - Shadow.SurfaceShadow = LightAttenuation.z * StaticShadowing; + Shadow.SurfaceShadow = LightAttenuation.z * StaticShadowing;//RadialLight灯光的阴影项计算不受AO影响,赋值Light function + per-object的ShadowProjection // SSS uses a separate shadowing term that allows light to penetrate the surface //@todo - how to do static shadowing of SSS correctly? - Shadow.TransmissionShadow = LightAttenuation.w * StaticShadowing; + Shadow.TransmissionShadow = LightAttenuation.w * StaticShadowing;//per-object SSS shadowing - Shadow.TransmissionThickness = LightAttenuation.w; + Shadow.TransmissionThickness = LightAttenuation.w;//per-object SSS shadowing } else {