xcrypt at February 21st, 2012 11:06 — #1
Hey, I'm trying to make my engine support 2D rendering with Direct3D.
I can do that with:
Now, I would like depth buffering enabled for 2D. But I don't want it to interfere with the 3D graphics
(2D should always render "on top of" the 3D graphics)
What can I do to achieve that?
reedbeta at February 21st, 2012 12:14 — #2
Render the 3D graphics, then clear the depth buffer, and render the 2D graphics.
thenut at February 21st, 2012 14:27 — #3
You could save on some fillrate by reusing the depth buffer if you deal with opaque overlaps, but quite often I use transparency where I have to use a painters algorithm anyway. In this case I just disable depth reads/writes. Teh google found me this (see DepthEnable / DepthWriteMask).