• Advertisement
Sign in to follow this  

Screenspace Shadow Mapping Help!?

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Edited by Madhed

Share this post


Link to post
Share on other sites

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).  [url]http://www.thomasannen.com/pub/cgi2002.pdf[/url] this is a paper i [b]tried[/b] to follow to get it to work when i was experimenting with it, but i never got it working.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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).

Edited by Ashaman73

Share this post


Link to post
Share on other sites

 


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.

Edited by Frenetic Pony

Share this post


Link to post
Share on other sites


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.

Share this post


Link to post
Share on other sites


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've implemented this by:

1) Implement SSAO biggrin.png the kind that uses random world/view-space points on a hemisphere/sphere around the pixel being shaded.

2) Take the code that finds sampling points on this (hemi)sphere, and change it to instead generate points along a line towards the light source.

Share this post


Link to post
Share on other sites


"Efficient virtual shadow maps for many point lights" It's

I know this paper, it is still more theocrafting than practically useful (~15-20ms frametimes on NVIDIA GTX Titan GPU + Intel Core i7-3930K CPU isn't awesome for games yet). I've hoped for a more pratically useful solution, we will see what useful changes happens once the new API approaches/consoles kicks in.

Share this post


Link to post
Share on other sites

Screen Space shadowing is like screen space reflections , but here you trace a vector pointing to light. if the z of your ray is less than the depth buffer you have a hit and means shadow. This algorithm produce artifacts when shadow casting objects are not present at screen space.

For shadow maps I believe you can create a priority system . Let's say your engine decides to have 20 shadow casting lights . So choose 20 of your lights that has the greatest effect .(Near the camera , Bigger Radius , ...). And also with the help of geometry shaders you can produce a cube map with one render pass.

Share this post


Link to post
Share on other sites

Thank you all for the posts. All of these are great suggestions and I certainly will ensure telanor takes a look at them. I think one of the hardest parts about shadows and our system is that we have a fully dynamic world. Most of the tricks of the trade are not able to be produced in our setup without creating some serious issues. I will keep this post in mind though. Any other suggestions or ideas would be greatly appreciated.

Share this post


Link to post
Share on other sites

For point lights, stencil shadows are very effective, but they are very hard to implement though. You will even need the casting geometry be extrudable and an enclosed mesh. But they are suitable for deffered illumination.

Share this post


Link to post
Share on other sites

http://www.youtube.com/watch?v=1DRa_pMidOo

We also have fully dynamic scenes and lots of pointlights but their shadows are not that important so we use screenspace raytracing. It's really simple to implement and its scale quite well. Quality is lot better than having no shadow solution for all lights. I should try to combine this with some screen space directional oclusion.

Share this post


Link to post
Share on other sites

Would you be willing to share how you did it? Or even work with Telanor directly? PM Him on the forum if you would please and maybe we can hook something up. Thank you very much

Edited by riuthamus

Share this post


Link to post
Share on other sites

 


"Efficient virtual shadow maps for many point lights" It's

I know this paper, it is still more theocrafting than practically useful (~15-20ms frametimes on NVIDIA GTX Titan GPU + Intel Core i7-3930K CPU isn't awesome for games yet). I've hoped for a more pratically useful solution, we will see what useful changes happens once the new API approaches/consoles kicks in.

 

 

Found that with shadow map caching it can work well for many dozens of lights. But indeed while hundreds may "possible" it's not practical on most systems. And you need all the overhead of the culling scheme, which is great if you're targeting hundreds of point lights to begin with. But we're still a long way off from having a city scene with hundreds of proper point lights, and I suspect that will just have to be brute forced one way or another.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement