# Area Lights in DirectX

So after reading https://www.guerrilla-games.com/read/killzone-shadow-fall-creating-art-tools-for-a-new-generation (a guerilla games presentation on PBR) I noticed the Area lights as opposed to the standard Directional, Point & Spot lights in DirectX can produce very realistic shadows.

Now a lot of the resources online talk about it and what it is but there's not much regarding implementation. Some websites online say that it is just an array of lights but I don't think that's what it is.

Can somebody explain how I can implement this (and maybe with some code). If you could include any links to some good resources regarding implementation that would be great aswell.

• It's not particularly hard to implement it, instead of calculating the distance from a point, you simply calculate it from the rectangle – Bálint Oct 15 '16 at 18:56
• BTW, I'm not sure if I want to look trough each 118 images to see what you're trying to achieve – Bálint Oct 15 '16 at 19:00
• Is it really that simple? I've read the chapter in gpu pro 5 on it (but still no implementation details) & a few other publications but I'm still a little puzzled. Could you post some code on it? – Arjan Singh Oct 16 '16 at 5:26
• Nope. Look at resources about point-rectangle distance. – Bálint Oct 16 '16 at 7:43
• So if I currently use float3 lightVec = L.Position - pos; for a point light, in order to calculate it from a rectangle what do I do? I'm just really confused on how I should do it for a rectangle. – Arjan Singh Oct 16 '16 at 12:08