浏览代码

Update comments

/main
Evgenii Golubev 8 年前
当前提交
a08f90a4
共有 2 个文件被更改,包括 8 次插入8 次删除
  1. 8
      Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.hlsl
  2. 8
      Assets/ScriptableRenderLoop/ShaderLibrary/CommonLighting.hlsl

8
Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.hlsl


float3 unL = positionWS - lightData.positionWS;
// Pick the axis along which to expand the fade-out sphere into an ellipsoid.
// Pick the axis along which to dilate the attenuation sphere into an ellipsoid.
// We define the ellipsoid s.t. r1 = r, r2 = (r + len / 2).
// We define the ellipsoid s.t. r1 = r2 = r, r3 = (r + len / 2).
// TODO: This could be precomputed.
float radius = rsqrt(lightData.invSqrAttenuationRadius);
float invAspectRatio = radius / (radius + (0.5 * len));

float3 unL = positionWS - lightData.positionWS;
// Pick the axis along which to expand the fade-out sphere into an ellipsoid.
// Pick the axis along which to dilate the attenuation sphere into an ellipsoid.
// We define the ellipsoid s.t. r1 = r, r2 = (r + |w - h| / 2).
// We define the ellipsoid s.t. r1 = r2 = r, r3 = (r + |w - h| / 2).
// TODO: This could be precomputed.
float radius = rsqrt(lightData.invSqrAttenuationRadius);
float invAspectRatio = radius / (radius + abs(halfWidth - halfHeight));

8
Assets/ScriptableRenderLoop/ShaderLibrary/CommonLighting.hlsl


return attenuation;
}
// Applies SmoothDistanceAttenuation() after stretching the fade-out sphere of the given radius
// into an ellipsoid with the specified aspect ratio and the longest axis.
// Applies SmoothDistanceAttenuation() after stretching the attenuation sphere of the
// given radius into an ellipsoid with the specified aspect ratio and the longest axis.
// Project the unnormalized light vector onto the expansion axis.
// Project the unnormalized light vector onto the dilation axis.
// It is equivalent to the expansion of the fade-out sphere into an ellipsoid.
// It is equivalent to stretching the attenuation sphere into an ellipsoid.
float scale = projL - projL * invAspectRatio;
unL -= scale * axis;

正在加载...
取消
保存