Sign in to follow this  

Portal culling... portal bounding boxes?

Recommended Posts

Hi, It's time for a (indoor) culling system. I'm not sure if this is the best choice, but I was thinking about portal culling, where I define the sectors manually. Between 2 sectors, there can be 1 or more portals. When I need to check which sectors are visible, I do:
checkSector( s : sector )
    for i:=0 to s.portalCount-1 do
        if inViewFrustum( s.portal[i] ) then
           viewList.add( s.portal[i].neighbourSector ) // if not added before...
           checkSector( s )
2 things I like to add is using a rectangle around the frustum for clipping. A huge sector could be visible via a tiny window. To prevent rendering a lot for nothing, I only render inside the rectangle that surrounds the portal. The other thing is that the frustum changes when entering the next sector. If I look into the next sector via that tiny window, my frustum should become very narrow as well. What you guys think? A good option? I'll have to add that I must calculate ~20 view lists per frame. Yep, the player camera is not the only one who needs a list... The culling does not have to be 100% accurate. I'm open for other techniques that suit with my indoor location. Although 'indoor' does not mean I only have corridors and small chambers. Big sectors with smaller ones inside is possible for example. Anyway, I must be able to calculate ~20 view lists for 20 different camera's per frame at a pretty fast rate. In case its good enough, there are a couple of things I wonder though. How to check if a portal is inside the view frustum? I mean, not every portal is a nice axis aligned simple door or window. You could look through a gigantic dome or something. I can make the portal "shapes" by hand and check for each of its polygons if its inside/intersects the view frustum. But I guess that's much work. And how to squeze the frustum through that "complex" shape? Using an axis aligned bounding box does not always provide good results either, if the portal is big and not aligned to a certain axis. Maybe using a rotated box (OBB) is better? Or build the portal out of multiple quads? Greetings, Rick

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