Sign in to follow this  

Using the Z-Buffer as a Render Target

Recommended Posts

At the end of my frame, when I no longer need to write or read the zbuffer again, I use the zbuffer as a render target. I go between the framebuffer and the zbuffer to do some multipass image processing effects on the screen, without having to allocate another buffer. This works great, but it is a tad slower than I thought it would be. By replacing the zbuffer with a standardly created secondary buffer, I get a speed increase. But, I cannot afford the memory to do this. So after running some profilers on it, I finally uncovered a warning that, because the z-buffer is zcompressed, it is slow to use it as an actual texture, and it reccomended turning off zcompression before I used it. Is it possible for me to turn off zcompression on the zbuffer before I start this effect, and then turn it back on aftwards so it can be back to normal for the next frame?

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