Jump to content
  • Advertisement
Sign in to follow this  
d h k

[Deferred Rendering] Complex Light Sources (ie. "Surface Lights"?)

This topic is 2344 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there,

whenever I see beautiful renders like these, I wonder how complex light sources are handled within a Deferred Rendering context.

7YqKZ.jpg

I have implemented point, spot and direction lights just fine, but look at the light source in the top right corner, how is this done? Is it just a white material that doesn't get affected by shading whatsoever (so it pretty much stays all white) and then a point light underneath to give the effect of a rectangular light source?

I've seen other games have stripes on the ground that illuminated the level, how is this done? Can all lights in real-life be simulated by just point, spot and directional lights somehow? Or is there a (set of) special technique(s) that help us out here (something like "surface lights" or illuminating materials like in 3DS MAX)?

Think of a ceiling light that is very narrow but extremely long, like this one for example:

dcp1591zh8.jpg

Is this just an array of point lights along the light source?

This is something that's been bothering me for a while, I was never able to find anything, search doesn't give results (probably due to not having the proper keywords) and I've never seen a lighting tutorial go past the point, spot and direction light types.

Please enlighten me (pun intended hur hur hur)! Thanks ahead of time!

Share this post


Link to post
Share on other sites
Advertisement
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. Edited by MJP

Share this post


Link to post
Share on other sites

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.


Yeah, using light baking and light probes to light scenes is quite a popular way of getting nice dynamic lighting without the massive runtime cost of doing it.

Share this post


Link to post
Share on other sites
Thanks a ton, this greatly helped me sort this out in my head! I've often been thinking about how point/spot/directional light types are really just three simplified models, similar to how polygons are a model (ie. a simplification) to describe actual (oftentimes round) three-dimensional shapes. Edited by d k h

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!