vault backup: 2025-02-13 12:06:27

This commit is contained in:
BlueRose 2025-02-13 12:06:27 +08:00
parent 461bb73f40
commit 5321a467c5

View File

@ -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
{