Game Development Community

When to use Portals?

by MaxAntinone · in Torque Game Engine · 12/31/2007 (3:32 pm) · 8 replies

Hey. I've read a little bit on binary space partitioning and generally how portals work and stuff, but I still don't completely understand how portals work.

I guess what I'm really asking here is not how they work, how, when and where should I use portals? I'm looking at the constructor brush options list here and I notice that portals are listed as something separate from all the other brush types.

I'm planning on making a single mission that primarily consists of several interiors that the user will teleport between, and it will be wasting a lot of render time if it's always rendering thins that can't be seen.

#1
12/31/2007 (5:16 pm)
Mainly use portals in things like doorways & windows.
if your single interiors are very complex,
you might also want to use them inside the interior as well.

use a portal whenever there's a lot of geometry which is usually obscured by a wall
but is sometimes visible through a window or around the corner, etc.

i recommend getting familiar w/ the concept of Zones.
#2
12/31/2007 (5:42 pm)
I second Orion, portals are very important. You should read as much as you can on portals, ask questions on the forum and experiment where possible. If your interiors don't have portals you will suffer a serious hit to your framerate.
#3
12/31/2007 (5:57 pm)
One thing i find useful to help see what's going on w/ portals is to set the interior rendering mode to Wireframe and then walk around a portalized interior. as portals enter & leave visibility, you can see occluded geometry pop in & out of existence. (and in some cases, ghosted objects such as other players actually deleted/created on the client-side)
#4
01/03/2008 (6:59 pm)
I can't test any of this right now because I'm home for break and the computer with Torque is at school. However, I'm doing a lot of modeling using Constructor right now.

So... what you're saying is, if there's a already a wall blocking off something, I don't need to worry about using a portal there?
And... do I just make the doorframe out of portals?
#5
01/04/2008 (8:02 am)
Think of portals as invisible windows which you put in places like windows & doors,
which speed up rendering.

you want your portals to be entirely embedded in the door or window-frame,
but at the same time as small as possible, to maximize performance.

so yeah, there's no point in putting a portal inside a wall.

it's confusing stuff!
i haven't yet seen a really good tutorial on portals.
#6
01/04/2008 (10:15 am)
You would use portals by placing the portal objects in passageways, like doorways, windows, or around corners. basically, a portal is used to quickly reject level geometry which isnt visible without having to check all the polygons against the view frustum. if you have a situation where you have two areas in a level connected by a hallway or passage way, and if the ONLY way you can see from one area into the other is through the passageway, then you could place a portal in the connecting passageway. the portal will break the area into two pieces. whichever piece the camera is in will be drawn automatically, but the other piece will only be drawn if the portal is visible.
#7
02/03/2008 (7:05 pm)
Okay, just so I'm PERFECTLY clear here, portals render as invisible, and the player will walk right through them?
#8
02/03/2008 (7:36 pm)
Quote:Okay, just so I'm PERFECTLY clear here, portals render as invisible, and the player will walk right through them?

Correct!