Vertex visibility

Hi All,
I am drawing a scene with a lot of objects and I need to check visibility of some points. I mean that it should be in view frustum and does not hide by other objects.

Is it possible? And how?

Thank you in advance.

hi mirage!
the answer is yes! every 3d app more complex than a sphere and a torus should be frustum culled. The tough part is that u have to do it by your hands…
try going on www.gametutorials.com
or

and give a look on the tutorial section (the tutorial about octree stuff has a frustum culling example 4 sure). Bye and be an happy camper

Hi gunslinger,

Maybe you do not understand me correctly. I need to check not only frustum visibility but hidding the point by other objects and other faces of point object also.

Best regards

OpenGL can do occlusion culling for you automatically.

//init code:
glDepthFunc(GL_LEQUAL);
glEnable(GL_DEPTH_TEST);

Doing this analytically (ie not limited to rendering purposes, infinite resolution) is quite complex, and really not an OpenGL problem.

I hoped that it can be solved by investigation of selection buffer. But I do not know exactly how I should define pick matrix to investigate corresponding object point.

The selection buffer is not hardware accelerated.
Occlusion culling is not the same as depth testing.

There are three occlusion extensions: http://oss.sgi.com/projects/ogl-sample/registry/

ARB and NV variants recommended; the HP one has less concurrency.

Also, since the occlusion query extensions aren’t supported on all hardware, the old method which still works for a small number of test points is to do a glReadPixels for the depth value or test for a “key” color on just those 1x1 pixel points you care about.

That sort of thing has been used for the “sun filtering through tree canopy” effect many times (often using a slightly larger area test), but gets too expensive for more than a few light sources.

Avi

Thank you for your replies.
In case of GLReadPixels I should define integer coordinates of window. How I can direct this window to interested point which defined in object space.

Originally posted by mirage93i:
In case of GLReadPixels I should define integer coordinates of window. How I can direct this window to interested point which defined in object space.

gluUnProject ?

GluUnproject? Hmmm… Maybe you mean GluProject. Anyway I understand what I should do. Thank you.