Screenspace Shadow Mapping Help!?

Started by
17 comments, last by FreneticPonE 9 years, 10 months ago

Done a few searches but found no relevant tutorials ( according to telanor ) about how to setup screenspace shadow mapping. Our current setup cascaded shadow mapping has some issues with point lights and models. I would like to create a less expensive method that provides us with decent results. Any and all help would be appreciated.

Advertisement

Found this siggraph crytek paper from last year. http://www.crytek.com/download/Playing%20with%20Real-Time%20Shadows.pdf

They are talking about shadows in general and there is a tiny little section about screen space self shadowing that seems to use this technique.

As a screen space technique it's not a drop-in replacement for regular shadow maps, really just an addon to increase fidelity.

I can imagine it working pretty well for range restricted point lights though.

Are you using deferred lighting? Then it should be a pretty straight forward to incorporate the tracing into the rendering of the point light polygons.

We are using deferred rendering. Right now Telanor has chosen to use cube map shadow mapping for the point lights ( creating a big issue with peformance ). I can have him post here to explain his choice and maybe that will give way to what we should be doing and how. Thanks in advance.

Actually it's not a shadow mapping algorithm but rather a ray tracer.

Trace the ray from the pixel towards the light source, if the sampled depth is lower than the interpolated depth of the ray than that original pixel must be occluded.

We are using deferred rendering. Right now Telanor has chosen to use cube map shadow mapping for the point lights ( creating a big issue with peformance ). I can have him post here to explain his choice and maybe that will give way to what we should be doing and how. Thanks in advance.

their's also hemispherical shadow mapping that reduces a cube shadow map down to 1 texture(or 2 for both sides). http://www.thomasannen.com/pub/cgi2002.pdf this is a paper i tried to follow to get it to work when i was experimenting with it, but i never got it working.

Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

I think that is where telanor got stuck as well, not sure... he said he did it some time ago. I noticed our shadows were not working for point ligths and brought it up. He seems to be content but I am not. Hence we are here


Right now Telanor has chosen to use cube map shadow mapping for the point lights ( creating a big issue with peformance ).

That is the way to go:

add cube map shadow mapping for point lights

-> be happy about how cool it looks

-> add more lights

-> see how bad the performance go

-> remove pointlights smile.png

To be honest, point light shadows are really extremely expensive, all shadow mapping variances are just too expensive to handle more than a handful of lights. One major issue is, that you need to render the scene multiple times which kills your performance by too many batches (this might change with new API approaches AZDO [Approach Zero Driver Overhead], Mantle,DirectX12), but for now shadow mapping is really,really expensive and real screen-space shadow mapping does not exist in any general, acceptable way.

The most common workaround:

1. use only point light shadows , if it is really necessary (even paraboloid shadow mapping), e.g. one major gameplay feature use one pointlight shadow

2. use shadow mapping for the most important light sources only (sun/moon plus some major light sources).


Right now Telanor has chosen to use cube map shadow mapping for the point lights ( creating a big issue with peformance ).

That is the way to go:

add cube map shadow mapping for point lights

-> be happy about how cool it looks

-> add more lights

-> see how bad the performance go

-> remove pointlights smile.png

To be honest, point light shadows are really extremely expensive, all shadow mapping variances are just too expensive to handle more than a handful of lights. One major issue is, that you need to render the scene multiple times which kills your performance by too many batches (this might change with new API approaches AZOD, Mantle,DirectX12), but for now shadow mapping is really,really expensive and real screen-space shadow mapping does not exist in any general, acceptable way.

The most common workaround:

1. use only point light shadows , if it is really necessary (even paraboloid shadow mapping), e.g. one major gameplay feature use one pointlight shadow

2. use shadow mapping for the most important light sources only (sun/moon plus some major light sources).

Nah, do enough work and you can get hundreds of point light shadows in the same scene. Culling is really a key, and not doing work when not necessary. Shadow map caching can do wonders for reducing everything from bandwidth to draw calls.

It's all a lot of work though, well documented work, but a lot of it. CSM scrolling has a basic overview for both point lights and a directional light: http://advances.realtimerendering.com/s2012/insomniac/Acton-CSM_Scrolling(Siggraph2012).pdf the basic idea is to check whether each light has a moving object inside its influence and then only the changes necessary, which should be a handful of objects if the point light is stationary and so is most of its environment.


you can get hundreds of point light shadows in the same scene.

Ahh cool, can you point me to some demo, game or presentation which managed this, especially the hundreds part sound really interesting, I'm not interest in caching single shadow maps, but multiple, point light shadow maps, because my game would profit from such a feature too.

"Efficient virtual shadow maps for many point lights" It's basically an extension of clustered shading to also allow culling for shadow mapping, along with a few hacks (the "virtual" part) for the maps themselves.

So if you've already got clustered deferred/forward going on your halfway there, which is nice.

This topic is closed to new replies.

Advertisement