Original Post
Say I want to draw a quad on the screen (say, like something covering a door to another room), is there a way to detect if any of that quad actually got drawn... (detect if it was fully occluded by other geometry...) Is there a way to count the number of pixels it actually effected? How about a way to detect the number of depth tests passed as opposed to those attempted (without counting the stencil buffer... aka, setting the stencil to 1 if depth failed, and 2 if depth passed, then go through the buffer and count the number of 2's vs the number of 1's and 2's... that make sense?) Just wondering if there's a built in DirectX api way of detecting these changes... since counting the stencil changes (ala reseting the stencil buffer everytime I need to draw a new portal/effect and then locking/copying the stencil buffer to read) seems a tad slow for my tastes... (I read something in an article once about improving a particle engine by detecting what was drawn last frame, and if something wasn't drawn, marking it as not visible as long as the camera didn't move... but it never said how to detect if nothing was drawn to the screen).