Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualMJP

Posted 12 July 2012 - 12:07 PM

The keyword you're looking for is "area lights". Your typical point/directional/spot light sources provide a limited approximation of real world light sources, since they essentially simulate a light that has an infinitely small area from the perspective of the surface being lit. In real-life all light sources obviously have non-zero area, and the larger their area the further off you will be when you try to approximate them with spot/directional/point light sources.

The problem with area lights in real-time graphics is that they can be costly to evaluate. Calculating the contribution of any light source requires integrating over the surface of that light source and applying your BRDF. For an infinitely-small light source this is easy, since you can approximate it as a dirac delta function which means you only need to calculate incident irradiance and apply your BRDF for one direction. You can't do this for area lights, so in offline renderers they're typically handled by using Monte Carlo methods to approximate the integral (basically you shoot a lot of rays with a known probability distribution). You can use Monte Carlo techniques in a real-time shader, although in some cases to get good specular it will require a lot of samples which can get really expensive. There's also proper soft-shadowing to worry about which can be just as important as the shading, which you get "for free" if you apply visibility to your samples in a ray-tracer but it's unlikely you'll be able to do it in a real-time shader. If you look around you can find some approximations for calculating area lights in real-time, but they will vary in quality and performance.

I'm guessing that for that Killzone 2 screenshot they're using a simple emissive material on the light itself, using a point or spotlight to approximate the direction contribution (or perhaps some other approximation), and the indirect contribution is baked into their lightmap. A lot of games will just bake the direct lighting from area lights into lightmaps, for instance Half-Life 2 and other Valve games do this all over the place.

#1MJP

Posted 12 July 2012 - 12:07 PM

The keyword you're looking for is "area lights". Your typical point/directional/spot light sources provide a limited approximation of real world light sources, since they essentially simulate a light that has an infinitely small area from the perspective of the surface being lit. In real-life all light sources obviously have non-zero area, and the larger their area the further off you will be when you try to approximate them with spot/directional/point light sources.

The problem with area lights in real-time graphics is that they can be costly to evaluate. Calculating the contribution of any light source requires integrating over the surface of that light source and applying your BRDF. For a infinitely-small light source this is easy, since you can approximate it as a dirac delta function which means you only need to calculate incident irradiance and apply your BRDF for one direction. You can't do this for area lights, so in offline renderers they're typically handled by using Monte Carlo methods to approximate the integral (basically you shoot a lot of rays with a known probability distribution). You can use Monte Carlo techniques in a real-time shader, although in some cases to get good specular it will require a lot of samples which can get really expensive. There's also proper soft-shadowing to worry about which can be just as important as the shading, which you get "for free" if you apply visibility to your samples in a ray-tracer but it's unlikely you'll be able to do it in a real-time shader. If you look around you can find some approximations for calculating area lights in real-time, but they will vary in quality and performance.

I'm guessing that for that Killzone 2 screenshot they're using a simple emissive material on the light itself, using a point or spotlight to approximate the direction contribution (or perhaps some other approximation), and the indirect contribution is baked into their lightmap. A lot of games will just bake the direct lighting from area lights into lightmaps, for instance Half-Life 2 and other Valve games do this all over the place.

PARTNERS