   Area light set up
  Hi everyoneAs i know, DirectX have the D3DLIGHTTYPE which can help you to set up the Point light, Directional Light, Spot Light.However, i want to set up an Area Light. For example i have a rectangular with the coordinate {(x1,y1,z1),(x2,y2,z2),(x3,y3,z3),(x4,y4,z4)}. I want to use this rectangular as the light source in my scene. How can i do that??Thanks for your help.P/s: Some example code will be better :D   
  The fixed function pipeline only supports those kinds of lights, however you can emulate other kinds of lights via projective texture mapping.Alternatively, if you use shaders you can implement any kind of light that you want.   ;  Area lights are quite computationally heavy. Especially if you want them also to cast proper shadows.While a point light is just one light source, area lights will probably have to be implemented as many individual (close to each other) lights. The number would ideally be infinite, but replacing the area with a matrix of "lights" will do the job, too.Do you really need them? Do you need to simulate the proper shading caused by area lights or do you just want soft shadows? - If the former and you want to use the fixed pipeline, you can try placing point lights over the rectangle, start with a lower number (maybe 5, one in each corner and one in the middle) and if the result is not good enough (won't be if the rectangle is large in comparison with the scene) add more. Don't forget that there is a limit on the number of lights the fixed pipeline can use.- If the later, there are methods of rendering soft shadows with standard light sources (of course not physically accurate).   ;  Thanks for your quick reply.Actually i have to implement the "Real-time,All frequency shadows in Dynamics Scenes" Here is the link of this paperhttp://www.thomasannen.com/pub/siggraph2008.pdfThis paper is the soft version of Convolution Shadow Maps (CSM). I have implemented the Convolution Shadow Maps. Now i have to implement this.And yes, i must use Are light, not "as many individual lights". So i need to know how to set up Area Light.I went around and come with this:+ Create a object with a mesh + Define the Object light properties like thisstruct Light{   float3 positionWS;   float3 directionWS;   float3 positionVS;   float3 directionVS;   float4 Ke;   float4 Ka;   float4 Kd;   float4 Ks;   float4 lightColor;   float4 globalAmbient;   float shininess;   float cosineTheta;   float lightAttenuationBegin;  // 10.0   float lightAttenuationEnd; // 20.0};Is this correct??;  Anyone ??   ;  It seems in the article they consider only the shadows, not how area lights affect lighting (shading) of the geometry.You'll have to try to understand and reproduce the method of shadow rendering they described there. The way how you decribe the area light in your code (your last post) is, IMHO, the least important problem here ;)   ;  Thanks for advice, i will give it a try   