I’m using a deferred engine to light my scene and in the outdoor environment everything is working just fine.
However, I’ve started working on an indoor scene and have noticed that my simplistic approach to deferred lighting is flawed with repect to walls and other ‘occluders’ - light from a light source behind an occluding wall (or other object) simply passes through them as if they weren’t even there.
The deferred lighting pass simply draws 3D bounding volumes and outputs the light colour to an accumulated colour buffer. There is no concept of ‘occluing’ ojects either in the Gbuffer nor in my engine at all.
My question is: how have people solved this kind of issue.
If I understand you correctly, you mean that lights don’t care about objects occluding their contribution.
This is simply a shadowing problem. You need to implement some shadowing algorithm (e.g. shadow mapping) in order to take the occluder objects into account. Otherwise you’ll get these kind of issues as deferred lighting/shading is nothing different from forward rendering from this point of view, both implement a local lighting model, not a global illumination model.
Some engines also use various bounding volumes to limit the light’s contribution volume in order to avoid shadow rendering cost in certain situations. These kind of tricks can be easily applied to static lights, however, for dynamic lights the ultimate solution is to use some shadow algorithm.
Yes you are correct about what I’m trying to say.
I was hoping to use many point lights as they are easy and cheap to render in the deferred system. However, casting shadows from them is another matter entirely and very expensive - especially for many static lights.
Point lights are too focused for general use (ie global illumination).
Directional light are too global!
Any other suggestions from people who have solved this kind of issue?