• Create Account

## Pointlight Issue

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.

### #1Quat  Members

563
Like
0Likes
Like

Posted 12 February 2014 - 08:02 PM

I am using deferred rendering so my pointlights are modeled by sphere geometry.  Suppose I place my pointlight so that it is tangent to a wall.  Of course the wall is not lit.  Now say I move the point light a little closer to the wall.  A section of the pointlight sphere intersects the wall, and that region is lit.  The problem to me is that this creates an unnatural lighting discontinuity between the region that intersects the sphere (and is lit), and the region that does not.

Is there a way people go about fixing this?  The obvious way would be to make my sphere pointlights cover the whole screen, but that isn't practical.  So I'm wondering if there are some tricks people do for this.

-----Quat

### #2MJP  Moderators

18215
Like
3Likes
Like

Posted 12 February 2014 - 09:14 PM

So with analytical point lights you have the concept of a "falloff", which basically controls how the lights intensity increases as you get further from the light's center. It's generally accepted that the most mathematically-correct falloff for a point light is 1/d^2. However the problem is that this falloff never actually hits zero, so it can't be distance bounded. One possible approach would be to calculate some distance at which the light won't provide any meaningful contribution, and then cap the light's influence at that distance.This works fine if you're using LDR rendering since you can exactly compute the a distance at which the contribution will result in 0 affect to a pixel, but with HDR rendering everything is relative to exposure so it's not really practical to do this.  This leads to most people "fudging" their falloff one way or another in order to be able to bound their lights for performance. For instance, you could replace the 1/d^2 term with a simple linear term that's guaranteed to hit 0 at a certain artist-authored distance. Or better yet, you can keep the 1/d^2 falloff and apply an offset to the curve so that the curve hits 0 at a certain distance. It's really simple: just compute the attenuation factor at your chose "max distance", and then subtract that value from the attenuation computed at the actual distance from the light.

Edited by MJP, 12 February 2014 - 09:15 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.