Jump to content
  • Advertisement
Royma

DX11 How to discard the border between 2 cascades

Recommended Posts

I've tried implement cascaded shadow maps.Every things goes right, except the location between different cascades.There are noticable borders on the screen.I don't quite understand the reason.And I've tried some methed for example blending different cascades or decrease the z value slightly when stenciling the cascade volume(I guess may be the sampling texcoord is beyond shadow map border, so decrease z value can lead to sampling from lower cascade, therefore avoid sample at the higher cascade's border). But these all take no effect.I want to no how this phenomenon is produced.And I found that sample from cubemap for point light shadow can avoid the border, why it works? And how can I fix this problem for CSMs?

Share this post


Link to post
Share on other sites
Advertisement

got Resolved! I use esm shadow maps, duo to the technique allow using any filtering method including mipmaps,so I use mipmaped shadow maps.I tried using SampleLevel instead of Sample, then the edges disapeared!

Share this post


Link to post
Share on other sites

Your issue there is that you're sampling different cascades within a 2x2 quad if pixels. Since the UV's between two cascades are unrelated, the pixel shader quad derivatives will end up calculating an incorrect mip level when a quad spans two cascades. The only way to ensure that you select correct mip level is to either manually calculate the mip level and use SampleLevel (which won't work with anisotropic filtering), or you need to manually compute the ddx/ddy gradients and pass them in to SampleGrad.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • 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!