Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your feedback on a survey! Each completed response supports our community and gives you a chance to win a $25 Amazon gift card!


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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 d k h   Members   -  Reputation: 435

Like
1Likes
Like

Posted 12 July 2012 - 09:07 AM

Hi there,

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

Posted Image

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:

Posted Image

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!

Sponsor:

#2 MJP   Moderators   -  Reputation: 11846

Like
2Likes
Like

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.

Edited by MJP, 12 July 2012 - 12:07 PM.


#3 phantom   Moderators   -  Reputation: 7597

Like
0Likes
Like

Posted 12 July 2012 - 12:09 PM

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.

#4 d k h   Members   -  Reputation: 435

Like
0Likes
Like

Posted 12 July 2012 - 02:29 PM

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, 12 July 2012 - 02:30 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS