How to find Light Direction from a Point on a surface to an Area Light How can I a find the Light Direction/Ray from a Point on a surface to an Area Light? Is there a universal technique to do this for all types of lights (circle, rectangle, sphere &amp; tube)?

Although this is for area lighting in a ray tracer, is there another way to implement area lighting through an emissive value that I can apply to any object or surface (I have seen this mentioned online)? As opposed to doing it like this. 

For example for a point light I know it can be done like this:

class PointLight : public Light 
{ 
    Vec3f pos; 
public: 
    PointLight(const Matrix44f &amp;l2w, const Vec3f &amp;c = 1, const float &amp;i = 1) : Light(l2w, c, i) 
    { l2w.multVecMatrix(Vec3f(0), pos); } 
    // P: is the shaded point
    void getDirectionAndIntensity(const Vec3f &amp;P, Vec3f &amp;lightDir, Vec3f &amp;lightIntensity) const 
    { 
        lightDir = pos - P; // compute light direction 
        float r2 = lightDir.norm(); 
        lightDir.normalize(); 
        lightIntensity = intensity * color / (4 * M_PI * r2); 
    } 
};
If you want to use only one sample to approximate analytical area lighting (e.g. for real-time applications), you can use Most Representative Point (MRP) approximation as described in "Lighting in Killzone Shadow Fall", "Real Shading in Unreal Engine 4" and "Moving Frostbite to PBR". This works reasonably well for specular approximation, though the energy conservation is a challenge. What I have found working best is to find a point on a light source with smallest angle from the view reflection vector, and the solution depends on the shape of the light (for example here's my solution for rectangular lights).

For diffuse evaluation there are numerical and analytical approximations depending on light shape presented in the papers, which also properly handle the horizon case. You can also try to use MRP for diffuse lighting, but I haven't found good approximations for it. Depending your application though diffuse MRP might result in feasible quality.

There's also some more recent work for evaluating area lighting integrals not using MRP. "Accurate Analytic Approximations For Real-Time Specular Area Lighting" deals with the specular evaluation via edge integrals, though I recall this method is patented. "Real-Time Polygonal-Light Shading with Linearly Transformed Cosines" looks quite promising, but I haven't checked the paper in more details.

For non-real time applications and ray tracing area lighting is fundamentally and mathematically much simpler problem. For your integrator you just check the incident radiance at each sample (ray intersection with the scene) and accumulate results for total radiance towards the output direction. The challenge is how to reduce variance of your integrator, but getting basic area lighting to work in a ray tracer is relatively simple.