• Advertisement
Sign in to follow this  

Using the Z-Buffer as a Render Target

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

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
Advertisement
Quote:
For a minute I thought you meant use the ZBuffer as a texture.


I think he is:

Quote:
it is slow to use it as an actual texture

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement