How to implement light occlusion in a delayed shading system?

I am introducing a deferred shader system that uses a computational shader (in DirectX 11) to select lights in tiles, so I can get thousands of lights at a stable frame rate. The problem arises when I have to determine if the light is blocked by the geometry of the scene. I mean, my point lights go through walls and bridges. I have a shadow map in terms of the main light (the sun), but creating a shadow map for each point light on the stage will require the creation of a thousand cubes, and this is not possible. So how does this problem usually deal? Games like Dead Space 3 and Battlefield 3 have a lot of lights on stage, but they don't bleed with solid objects.

+4
source share
1 answer

One direct solution would be to use Screen-Space Ambient Occlusion approaches. There you try to evaluate occlusion based on a sample of the neighborhood. One of my approaches is SSDO , which is directly aimed at creating shadows in the screen space. You will likely get a lot of artifacts in complex scenes. The advantage is that SSDO also adds some global lighting effects.

I think most games / engines try to overcome such problems with preprocessing steps.

  • Static lighting: if your light source does not move (glows in buildings ...), calculate Lightmaps or some additional vertex attributes that contain light.

  • Adjust the light: just adjust the drop distance or intensity or location until there is noticeable bleeding.

  • Some of your own ideas: depending on your idea of ​​light (sphere / disk?), You can calculate the cropped shape for the lights. The pixels behind the wall do not lie inside the new volume of light and are not illuminated in this way. If you cannot arbitrarily shape your volume of light, you can probably add one or two planes to each light defining the walls. These planes can be undefined for most light sources and can only be pressed on the GPU to illuminate near a wall. How can I check the pixel on which side it lies during the lighting process for the corresponding light.

+2
source

All Articles