View Full Version : detect write to (depth-)buffer

10-15-2011, 04:57 AM

I want to do the following:
1. render some object
2. check if something is drawn

One soultion I could imagine, is to use a stencil buffer:
1. clear/enable stencil buffer (ALWAYS)
2. render some object
3. iterate through stencil buffer and check if a write happened

this seems to be too expensive, because I just want to know IF something was drawn and not WHERE.

Is there some kind of flag with which I can do the following:
1. set write flag to FALSE
2. render some object
3. check if write flag is set


10-15-2011, 05:11 AM
That's what GL occlusion queries are for.

10-15-2011, 05:27 AM
thank you.. it worked!! :)
Is it good practice to use this method for occlusion culling?