|
|
|
|
|
|
// We define the ellipsoid s.t. r1 = (r + len / 2), r2 = r3 = r. |
|
|
|
// TODO: This could be precomputed. |
|
|
|
float radius = rsqrt(lightData.invSqrAttenuationRadius); |
|
|
|
float invAspectRatio = radius / (radius + (0.5 * len)); |
|
|
|
float invAspectRatio = saturate(radius / (radius + (0.5 * len))); |
|
|
|
|
|
|
|
// Compute the light attenuation. |
|
|
|
float intensity = EllipsoidalDistanceAttenuation(unL, lightData.invSqrAttenuationRadius, |
|
|
|