Jump to content
  • Advertisement
Sign in to follow this  
george7378

Shadow map size-based artifact

This topic is 1866 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 everyone,

 

I've noticed that when I raise the size of my shadow map above 512x512, the following artifact creeps in at the bottom:

 

[attachment=14836:artifact1.jpg]

 

I'm not sure why - it only appears when I raise the shadow map size! Is it a simple issue?

 

Thanks.

Share this post


Link to post
Share on other sites
Advertisement

Can you show the same screen shot with a smaller resolution shadow map?  Also, what is the artifact that you are describing - the shape of the shadow itself?

Share this post


Link to post
Share on other sites

Hi, sorry if it wasn't visible.

 

The only thing casting a shadow should be the pyramid, but in the first pic there's a long rectangle added onto the shadow for some reason. Here's how it looks with a 512 shadow map:

 

[attachment=14838:arti2.jpg]

 

There's no rectangle at the bottom. Also, in the first picture, the artefact is shadowing the object itself too, so for some reason it seems to think there's an object blocking the light there.

Share this post


Link to post
Share on other sites

Is your object hitting the edge of the shadow map? That's why we need to see what the actual shadow map looks like.

Share this post


Link to post
Share on other sites

I thought it might have been, but this is what I get when I render the shadow map straight to the screen - they both look the same:

 

512:

 

[attachment=14839:512sm.jpg]

 

1024:

 

[attachment=14840:1024sm.jpg]

 

Is there a way to save the shadow texture itself to a file? I guess that would be a better diagnostic!

Share this post


Link to post
Share on other sites

Ah, well I dumped my render surface to a png file and it came out with this at a size of 1024x1024. I guess that's the problem. I should also say that the cutoff starts at 768 pixels down - the size of my back buffer. So does that mean I can only use maps smaller than my back buffer?

 

[attachment=14841:test.png]

Share this post


Link to post
Share on other sites

No, the backbuffer size shouldn't matter. Maybe check to make sure your viewport is correct when you're rendering your shadow map?

Share this post


Link to post
Share on other sites

Its been a while, but don't you need to set a z/depth-buffer thats at least the size of your current render target? Experienced some issues like this a while ago, I swear it was something with depth buffer, but I can't really tell anymore.

Share this post


Link to post
Share on other sites

As said above, did you created separate depth/stencil buffer beside your RT on which you render shadow depth? And set it before render to shadow RT?

Did you set new viewport based on shadow map size/camera properties?

Edited by belfegor

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!