Sign in to follow this  
malyskolacek

shared DS surface in shadow mapping

Recommended Posts

In my recent work on shadow mapping I came across one issue. I render the shadow map to a D3DFMT_R32F color surface together with a depth/stencil surface for z-buffering. I don't really use the DS surface anywhere, it's only for z-buffering. Therefore I thought of having one large DS buffer (of the size of the largest shadow map) and reusing it for all shadow map renderings. It could save memory but I have no clue about how this would work performancewise. I remember reading somewhere that repeated Clear and rendering to the same surface during a frame is bad, but I'm not sure. Do you have any experience with this? Thanks for replies

Share this post


Link to post
Share on other sites
Quote:
Original post by malyskolacek
I remember reading somewhere that repeated Clear and rendering to the same surface during a frame is bad, but I'm not sure. Do you have any experience with this?

I suppose it could be, but note the tradeoffs that you have made:

(a) Decreased video memory usage (varying levels of importance, depending on your target hardware)
(b) Reduced number of state changes, since you no longer have to change DS buffers.

I guess the easiest way to find out would be to just try it out. It should be very easy to switch between the two, anyhow.

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