PDA

View Full Version : How to know if a particular point is visible/Not?



johan.schmidt
09-09-2010, 02:25 AM
Hello,
As you know that in Opengl, we can enable depth to exclude all those points from drawing mesh which are masked by other objects while viewing from camera - glEnable(GL_DEPTH_TEST);

Now, my question is, how can I know if a particular point will be visible or not. I don't want to draw that point, but somehow I want to know if that point is visible from camera or occluded/masked by other objects in the way, thereby making it invisible. Is there any function in OpenGl that can tell this?

What exactly I am looking for is some kind of an output which tells like "true/false" if a particular point will be visible or not?

Thanks

ZbuffeR
09-09-2010, 02:34 AM
This sounds like a job for occlusion queries
http://www.opengl.org/wiki/Occlusion_Query
http://oss.sgi.com/projects/ogl-sample/registry/ARB/occlusion_query.txt

johan.schmidt
09-09-2010, 03:40 AM
Hi, Thanks for your answer. I will look into it and see if it works.