|
|
|
|
|
|
diffuseLighting = float3(0.0, 0.0, 0.0); |
|
|
|
specularLighting = float3(0.0, 0.0, 0.0); |
|
|
|
|
|
|
|
// TODO: This could be precomputed. |
|
|
|
float halfWidth = lightData.size.x * 0.5; |
|
|
|
float halfHeight = lightData.size.y * 0.5; |
|
|
|
float3 unL = lightData.positionWS - positionWS; |
|
|
|
float3 unL = lightData.positionWS - positionWS; |
|
|
|
[branch] |
|
|
|
if (dot(lightData.forward, unL) >= 0) |
|
|
|
{ |
|
|
|
// The light is back-facing. |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// TODO: This could be precomputed. |
|
|
|
float halfWidth = lightData.size.x * 0.5; |
|
|
|
float halfHeight = lightData.size.y * 0.5; |
|
|
|
|
|
|
|
// Define the dimensions of the attenuation volume. |
|
|
|
// TODO: This could be precomputed. |
|
|
|