Archived

This topic is now archived and is closed to further replies.

toroso

Z Buffers in 2D

Recommended Posts

Thanks for the answer.

When writing this kind of question I probably should describe what I intend to do in order to get an answer that applies to me.

I''m doing a windowing system where windows can be transparent. My first thought solution was to draw the windows from back to front.

However, now I''m thinking that by using z buffers, I can benefit from some Direct3D optimization. I include depth information for each window, and D3D will only draw what is needed.

Is it worth the effort?

Probably the answer depends on how many windows I will have, and the answer is that there won''t be that many. And in most cases, more than half of the windows will need to be painted.

Share this post


Link to post
Share on other sites
And just when I asked the question, I found the answer... From the D3D documentation:

"If the overdraw averages less than 2, you can achieve the best performance by turning z-buffering off and rendering the scene from back-to-front."

"Overdraw is the average number of times that a screen pixel is written to."

Search and ye shall find...

Share this post


Link to post
Share on other sites