Jump to content
  • Advertisement
Sign in to follow this  
malyskolacek

shared DS surface in shadow mapping

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

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!