How to tell if a 3D point will be hidden

I want to place numbers next to vertices in a model only if that vertex is visible. I am using outline fonts and they will be hidden by the foreground images, but often part of the text gets clipped by adjacent objects. I have an image of this but don't see how to include it in this post. It seems i can only insert images based on URL's.

So i thought if i know that a particular vertex is not hidden, i could disable the depth test so the text would always be viable.

As always, there are several ways you can do this. tonyo_au's given you one. You can fetch the occlusion query results back, and use in an "if" expression in your app code to decide whether to draw the text. A incrementally more efficient approach is to use those same occlusion queries in combination with conditional rendering (glBeginConditionalRender()...glEndConditionalRend er()) to move the "if" check down into the GL driver, and possibly onto the GPU.

And if you have a lot of vertices/texts to draw and you can preupload your text strings onto the GPU (in a texture, etc.), a potentially more efficient approach is to do your own occlusion checks on the GPU and generate your own list of "visible points" to render text for. Something like: