Advertisement Jump to content
Sign in to follow this  
grunt123

Improving cascade shadow

This topic is 1876 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

Hi,

 

I'm working on improving cascade shadows for my project.  The main problem is that for cascades that are distant (i have 4 cascades) i see some kind of 'chain-saw' looking edge.  i thought about implementing SDSM, but my project doesn't allow GPU-generated data to be used for cascade bounds ... (we have two threads, one doing all update and the other doing all the rendering)  

 

Is there any other way of countering this kinds of visual problem in cascade shadow?

Share this post


Link to post
Share on other sites
Advertisement

If you can't improve the effective resolution of your cascades (either by increasing the resolution of your shadow map or by tightening your cascades so that they better fit your frustum), then using more filtering will help reduce aliasing. Are you doing any PCF at the moment?

Share this post


Link to post
Share on other sites

yes, 3x3 pcf/soft shadow. (blurring)  But, still seeing 'chain-saw' edges, especially in distant cascades .... What type of filtering can improve the situation? maybe, EVSM? 

Share this post


Link to post
Share on other sites

yes, 3x3 pcf/soft shadow. (blurring)  But, still seeing 'chain-saw' edges, especially in distant cascades .... What type of filtering can improve the situation? maybe, EVSM? 

 

Variance shadow mapping (Of one implementation or another) can indeed get a lot softer (without noise) compared to PCF. I'm pretty sure Crytek uses VSM on their most distant cascades both to hackily simulate large penumbras as well as avoid any glaring aliasing.

 

Still, blurring is only going to get you so much. The first time I saw temporal aliasing was for shadows anyway, so you might want to try that. Crytek (again) had a reprojection technique to avoid ghosting for temporal aliasing. It was for scene aliasing rather than shadow aliasing, but the same principles should apply. You can find it somewhere under Crytek's presentations page. http://www.crytek.com/cryengine/presentations

Edited by Frenetic Pony

Share this post


Link to post
Share on other sites

You can certainly do more than 3x3 filtering, provided you can afford the GPU cost. It's possible to get up to 7x7 or even 9x9 on higher-end GPU's. VSM is definitely an option as well, and with pre-filtering you can potentially get some very wide kernels as well. You can also use MSAA with VSM, although that will increase memory usage and rendering costs. If you want to play around with these things, I have a sample on my blog that has various PCF and VSM techniques implemented.

 

I don't think any temporal reprojection techniques are going to get you anywhere with shadow aliasing. They're designed to limit changes in a single pixel from frame-to-frame by adjusting sample positions, which isn't really going to do anything to help with aliasing that occurs during the rasterization of the shadow map. Filtering on the other hand *will* help, but will also cover up details if you use wider kernels. There's also going to be a practical limit on how much filtering you can use, and if the aliasing is too severe it will still be noticeable even with a very wide filtering kernel.

 

For cascaded shadow maps it's actually possible to totally eliminate temporal issues due to camera movements, by "stabilizing" your cascades. The trade off is that the cascades aren't as tightly fit to the view frustum as they could be, so you lose some effective resolution. Lots of big-budget games do this at the moment. If you're interested, it's also implemented in the sample that I linked to.

If you get desperate, you can always consider setting a maximum cascade distance that's closer than your max viewable distance and fading out your shadows as you approach that max cascade distance. Obviously you lose shadows on distant geometry, but the resulting shadows on the closer geometry will get higher effective resolution.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!