Sign in to follow this  
Followers 0
Funkymunky

Cascaded Shadow maps in a deferred renderer

3 posts in this topic

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.

0

Share this post


Link to post
Share on other sites

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.

1

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.

0

Share this post


Link to post
Share on other sites

I realized that about 5 minutes into trying to implement it and have since moved to a transform feedback / render to vertex stream approach

0

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
Sign in to follow this  
Followers 0