Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualHodgman

Posted 01 September 2012 - 01:20 AM

I find it slightly surprising that it uses a full scene render per light-source. I've noticed that modern games seem to use a pretty high number of light sources

Yes, some new games do use as many as a thousand dynamic lights, however, only a small number of them will actually be shadow-casting lights.

Also, in specific scenes / specific scenarios, you don't need a "full scene" render per light.
e.g. I once worked on a racing game where all of the environment shadows used static light-map techniques, so only the dynamic cars themselves needed shadow mapping. We also used "deferred shadow maps" where you accumulate the shadow information into a full-screen texture. We would render each car individually into it's own shadow map (which makes good use of low resolution shadow textures), and then composited each single shadow into the full-screen texture. This meant we had to render (at most) an extra numCars * numLights for shadows -- not wholeScene * numLights.
You should also perform frustum culling (and full visibility culling if your scene supports it) on the light, so that you're only rendering objects that are visible from it's viewpoint. If no cars were visible from a particular light, then no extra rendering was performed for it.

Moreover, the method works by rendering from the lamps point of view, so the light is limited to a frustum pointing in one specific direction. I presume you would have to do multiple renders for a light spreading out in all directions?

Yes, the most obvious solution is 6 different 90º frustums rendered to a "cube-shadow-map". There's also hemisphere-based solutions that use fewer frustums (Dual-Paraboloid SM or Dual Sphere-Unfolding SM), or complex distortion methods like CSSM, but these alternatives generally exhibit more distortion than the basic solution.

#1Hodgman

Posted 01 September 2012 - 01:12 AM

I find it slightly surprising that it uses a full scene render per light-source. I've noticed that modern games seem to use a pretty high number of light sources

Yes, some new games do use as many as a thousand dynamic lights, however, only a small number of them will actually be shadow-casting lights.

Also, in specific scenes / specific scenarios, you don't need a "full scene" render per light.
e.g. I once worked on a racing game where all of the environment shadows used static light-map techniques, so only the dynamic cars themselves needed shadow mapping. We also used "deferred shadow maps" where you accumulate the shadow information into a full-screen texture. We would render each car individually into it's own shadow map (which makes good use of low resolution shadow textures), and then composited each single shadow into the full-screen texture. This meant we had to render (at most) an extra numCars * numLights for shadows -- not wholeScene * numLights.
You should also perform frustum culling (and full visibility culling if your scene supports it) on the light, so that you're only rendering objects that are visible from it's viewpoint. If no cars were visible from a particular light, then no extra rendering was performed for it.

Moreover, the method works by rendering from the lamps point of view, so the light is limited to a frustum pointing in one specific direction. I presume you would have to do multiple renders for a light spreading out in all directions?

Yes, the most obvious solution is 6 different 90º frustums rendered to a "cube-shadow-map". There's also hemisphere-based solutions that use only two frustums, but the exhibit more distortion.

PARTNERS