vault backup: 2025-02-13 12:49:39
This commit is contained in:
parent
5321a467c5
commit
152f067a54
@ -663,7 +663,7 @@ void GetShadowTerms(float SceneDepth, half4 PrecomputedShadowFactors, uint Shadi
|
|||||||
half StaticShadowing = 1.0f;
|
half StaticShadowing = 1.0f;
|
||||||
#endif
|
#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)
|
// 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);
|
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
|
// 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
|
// 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;
|
Shadow.TransmissionShadow *= LightAttenuation.z;
|
||||||
|
|
||||||
// Need this min or backscattering will leak when in shadow which cast by non perobject shadow(Only for directional light)
|
// Need this min or backscattering will leak when in shadow which cast by non perobject shadow(Only for directional light)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user