Portals

my thoughts are going to be random…
ok, opengl does the screen clipping of polygons. however, to make us of portals, you have to clip ploygons that show through the portal.
if you were to start the redendering from the furthest area, then recurse back, you can only draw the poly’s that face you, and you can turn off the z buffer check.
each sector would have an id, and you stop traversing when you either hit a sector you already hit, or the portal is not in view.
just an idea.
my ploblem in my head is this.
if you let opengl handle the clipping, how can i recreate a frustum that passing through the portal which will be used to check if the net portal is in view, and continual clipping of the frustum will lead to one that has N number of sides…
so, should i not let opengl do the clipping (then how would i do it), or should i keep a copy of the frustum…and can i get frustum info from opengl…

ok, opengl does the screen clipping of polygons. however, to make us of portals, you have to clip ploygons that show through the portal.

Portals are a method for sorting your data, similiar to BSP’s in that they both have a heirarchy to store their leafs, but different in that way also. Portals recognize that if you are close enough to a portal, you can’t be anywhere else in the tree, thus only drawing the sectors designated.

if you let opengl handle the clipping, how can i recreate a frustum that passing through the portal which will be used to check if the net portal is in view, and continual clipping of the frustum will lead to one that has N number of sides…so, should i not let opengl do the clipping (then how would i do it), or should i keep a copy of the frustum…and can i get frustum info from opengl…

After your done calculating the PVS, you will have to recurse backwards to calculate which polygons you should include inside your frustum. By letting OpenGL “clip” for you, you are still rendering it to world space, but your OpenGL drivers just won’t be copying the pixel data for faces which aren’t Front facing (but it doesn’t matter because a big slow down is in the transformation of vertices).

Hope that helps. I am in the process of writing up a frustum tutorial, so hopefully that will help (It’ll be posted on our web-page when done 8).

-Nathan d’Obrenan www.firetoads.com