# Pointlight Issue

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

## Recommended Posts

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.

##### Share on other sites

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

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 15
• 11
• 9
• 9
• 40
• ### Forum Statistics

• Total Topics
634130
• Total Posts
3015704
×