Cascaded Shadow maps in a deferred renderer

Started by
2 comments, last by Funkymunky 10 years, 6 months ago

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.

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.

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.

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

This topic is closed to new replies.

Advertisement