....but Project returns a Vector3...how do I get a 2d quad from the Vector3 returned by Project?
x & y should be in viewport coords, eg. in range x = 0 - res.width & y = 0 - res.height, z is depth in 0 - 1 range (i think you don't need it for your light technique).
For points laying outside of view frustum you need to clamp them in these ranges (but before this you frustum cull these lights).
To get 2d quad/rectangle you need to find its bounds:
Vector2 min = new Vector2(float.MaxValue, float.MaxValue);
Vector2 max = new Vector2(float.MinValue, float.MinValue);
float minDepth = float.MaxValue;
foreach (Vector3 v in lightFrustumProjectedPoints)
if (v.X < min.X)
min.X = v.X;
if (v.Y < min.Y)
min.Y = v.Y;
if (v.X > max.X)
max.X = v.X;
if (v.Y > max.Y)
max.Y = v.Y;
if (v.Z < minDepth)
minDepth = v.Z;
Clamp(min.X, 0f, viewport.width);
Clamp(min.Y, 0f, viewport.height);
Clamp(max.X, 0f, viewport.width);
Clamp(max.Y, 0f, viewport.height);
Clapm(minDepth, 0.0f, 1.0f);
although i have not used this technique for lights.
You can try with light volumes, spheres/box for point, pyramid/cone for spot lights and fullscreen quad for directional.
Thread with nice explanation.
Edited by belfegor, 15 June 2013 - 12:23 AM.