• Advertisement
Sign in to follow this  

Cascaded Shadow maps in a deferred renderer

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

I have a deferred rendering implementation.  I'm implementing shadows, and have decided to do a cascaded shadow-maps approach to support large scenes.  It occurs to me that I have two options for how to do this.

 

I'm already transforming all the vertices for rendering to the various layers of my deferred implementation.  I could pass additional matrices for the cascade levels and simply output additional textures representing the shadow maps.  Alternatively, I could draw everything a second time explicitly for the purposes of shadow mapping.

 

In the first approach, my limitation is that each cascade layer will be the same dimensions as the framebuffer, which is pretty big.  In the second approach, I could use, say, 1024x1024 sized shadow maps, but I'd be doing all my draw calls a second time.

 

Does anyone have a suggestion as to which would be the more favorable approach?  I'm going to go ahead and implement it in a way that I can do either to see what the results are, but I was just wondering if anyone had any insights.

Share this post


Link to post
Share on other sites
Advertisement

If you've got a light source such as the sun, casting shadows of off-screen geometry across the scene, then it seems like you'd want to cull/draw the main camera and the shadow camera separately.

Share this post


Link to post
Share on other sites

You'll have to re-draw your geometry to generate your shadow map. Your shadow map and your main camera will use completely different projections, so you can't do them both in one pass. If you think about it this should make sense intuitively: an object that is off-screen can still cast a shadow that's visible on the screen.

Share this post


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

  • Advertisement