Originally posted by DamirH
View Post
Now lets get back to the focus of the thread.
FScreenSpaceData ScreenSpaceData = GetScreenSpaceData(ScreenUV); float NoL = saturate(dot(ScreenSpaceData.GBuffer.WorldNormal, DeferredLightUniforms.NormalizedLightDirection)); Settings.TransitionScale = SoftTransitionScale.z * lerp(0.1, 1.0, NoL);
#if SPOT_LIGHT_PCSS { float CotanOuterCone = DeferredLightUniforms.SpotAngles.x * rsqrt(1. - DeferredLightUniforms.SpotAngles.x * DeferredLightUniforms.SpotAngles.x); float WorldLightDistance = dot(DeferredLightUniforms.NormalizedLightDirection, DeferredLightUniforms.LightPosition - WorldPosition); Settings.ProjectedSourceRadius = 0.5 * DeferredLightUniforms.SourceRadius * CotanOuterCone / WorldLightDistance; Settings.TanLightSourceAngle = 0; } #endif
#if SPOT_LIGHT_PCSS { float CotanOuterCone = DeferredLightUniforms.SpotAngles.x * rsqrt(1. - DeferredLightUniforms.SpotAngles.x * DeferredLightUniforms.SpotAngles.x); float WorldLightDistance = dot(DeferredLightUniforms.NormalizedLightDirection, DeferredLightUniforms.LightPosition - WorldPosition); Settings.ProjectedSourceRadius = 0.5 * DeferredLightUniforms.SourceRadius * CotanOuterCone / WorldLightDistance; Settings.TanLightSourceAngle = 0; } #endif
Comment