From 152f067a545713570a62995977b2be71a2125931 Mon Sep 17 00:00:00 2001 From: BlueRose <378100977@qq.com> Date: Thu, 13 Feb 2025 12:49:39 +0800 Subject: [PATCH] vault backup: 2025-02-13 12:49:39 --- .../Rendering/RenderingPipeline/Lighting/Lighting.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/03-UnrealEngine/Rendering/RenderingPipeline/Lighting/Lighting.md b/03-UnrealEngine/Rendering/RenderingPipeline/Lighting/Lighting.md index f635bbe..0b6bd83 100644 --- a/03-UnrealEngine/Rendering/RenderingPipeline/Lighting/Lighting.md +++ b/03-UnrealEngine/Rendering/RenderingPipeline/Lighting/Lighting.md @@ -663,7 +663,7 @@ void GetShadowTerms(float SceneDepth, half4 PrecomputedShadowFactors, uint Shadi half StaticShadowing = 1.0f; #endif - if (LightData.bRadialLight || SHADING_PATH_MOBILE)//一般是 PointLight or SpotLight。径向衰减(radial attenuation):指光照强度随距离光源的远近而衰减的特性(通常遵循平方反比定律)。 + if (LightData.bRadialLight || SHADING_PATH_MOBILE)//RadialLight或者是移动端使用以下逻辑。bRadialLight一般是 PointLight or SpotLight。径向衰减(radial attenuation):指光照强度随距离光源的远近而衰减的特性(通常遵循平方反比定律)。 { // Remapping the light attenuation buffer (see ShadowRendering.cpp) @@ -682,11 +682,11 @@ void GetShadowTerms(float SceneDepth, half4 PrecomputedShadowFactors, uint Shadi float DynamicShadowFraction = DistanceFromCameraFade(SceneDepth, LightData); // For a directional light, fade between static shadowing and the whole scene dynamic shadowing based on distance + per object shadows - Shadow.SurfaceShadow = lerp(LightAttenuation.x, StaticShadowing, DynamicShadowFraction); + Shadow.SurfaceShadow = lerp(LightAttenuation.x, StaticShadowing, DynamicShadowFraction);//根据计算出动态阴影的衰减值来插值ShadowProject与静态阴影。x:方向光阴影 // Fade between SSS dynamic shadowing and static shadowing based on distance - Shadow.TransmissionShadow = min(lerp(LightAttenuation.y, StaticShadowing, DynamicShadowFraction), LightAttenuation.w); + Shadow.TransmissionShadow = min(lerp(LightAttenuation.y, StaticShadowing, DynamicShadowFraction), LightAttenuation.w);// w:per-object SSS shadowing - Shadow.SurfaceShadow *= LightAttenuation.z; + Shadow.SurfaceShadow *= LightAttenuation.z;//Light function + per-object shadows in z Shadow.TransmissionShadow *= LightAttenuation.z; // Need this min or backscattering will leak when in shadow which cast by non perobject shadow(Only for directional light)