Sign in to follow this  
Dominicds

Portals vs. OC

Recommended Posts

For a FPS with indoor levels, what are the advantages of using portals over hardware occulsion culling? If I understand correctly, both techniques perform basically the same action. Occulsion culling however, is hardware accelerated, wouldn't that make portals virtually worthless?

Share this post


Link to post
Share on other sites
Having used portals but no HW culling I can give you at least a part of the image... First, the advantages of portals over HW OC: In truly indoor levels, portals are the perfect choice IMO. They give you a relatively simple way to cull large parts of your scene and in case of portals you only pay for what you render, not for the complexity of teh entire scene. The culling on portals is really very simple as it's only about adjusting your clipping planes according to the portal.
Here come the cons: In order to use portals, you have to define them in a special way. I don't know any existing, free tools that would do it well (ok, you could use some q3 tools, but i dont have any exp with them). You can either build your level via csg, use bsp portalization, place portals by hand or use other tricks. Next, you have to manage your scenegraph specifically to account for objects spanning portals.
How about HW OC then ? Well, AFAIK, you have to design fairly sophisticated caching algorithms in order to avoid stalls in your pipeline, though the spatial structure may be fairly easy, like an OCTree. HW OC, or OC in general gives you the opportunity to cull not only using the indoor level geometry, but also any objects placed inside of it, like furniture. With portals, you'd usually be culling only using the general room shapes.
I don't know about HW culling speed, but for indoor environments and well-defined portals (no portal-soups) the culling takes virtually no time and it is possible to use portals for other tasks, like pathfinding.
I'm willing to use portals for the indoor part of my rendering and some sort of OC for the outdoors, I'm not sure if HW OC will be suitable though. You can read some of YannL's posts about OC in general, he also talks about HW OC's disadvantages and I've exchanged a few words with him about portal rendering.

generally HW OC and portal culling do perform teh same action, they are a form of HSR (Hidden Surface Removal), but saying that they do it in the same way and have similar cons and pros would be a huge mistake. They perform in a completely different way, HW OC won't make portals worthless only because it's HW. Accelerated by HW doesn't need to mean "faster".

Share this post


Link to post
Share on other sites
Portals are a form of occlusion culling. Perhaps you mean to compare them against rasterized occlusion? You can combine them, testing the occlusion of a portal against already-rendered geometry, such that you can halt traversal along that edge in the graph. Usually it's quicker to do a geometric test though.

Share this post


Link to post
Share on other sites
Portals are not rendered useless by hardware occlusion queries. Portalisation makes the assumption that a large set of objects, the sectors, are fully blocking and the only way to get visibility is through portals. This means you can reverse visibility testing, instead of trying to prove lots of objects occluded, you spend a little time trying to prove a few objects, the portals, visible. This works great as long as the scene is portal friendly, i.e. an architechtural indoor scene. And just as was said, submitting portals to occlusion culling is certainly possible and can be a big win since a visible portal can cause quite a lot of triangles to be rendered.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this