Game Development Community

Quick question on Portals

by Eric Thomas Patton · in Torque 3D Professional · 04/17/2010 (7:11 pm) · 2 replies

I've read up and played around with Zones and Portals and understand the point of zones (culling whatever is inside if you are outside and vice versa), but I'm still a little unclear on what exactly portals do.

Here is what I assume they do, but from what I've seen they don't seem to do this. I had assumed that having a portal on the border of a zone would allow whatever is inside the zone to be rendered if you are looking at that portal, and while this works (or at least renders the stuff), I tried looking at my zone from a different opening and it still rendered when the portal was not in view.

Am I missing the point of portals? I have quite a bit of geometry in some rooms and would like them to not eat up RAM and bog down the fps, but I'd also not like to have stuff suddenly appear when you head inside a room out of nowhere to accomplish this. I'm sure this is just me not understanding what is going on and I would greatly appreciate some insight.

Thank you!

#1
04/18/2010 (5:55 am)
Yeah, that's pretty much how portals work - as windows which you can look through into a zone - they turn green when you've got them touching 2 zones correctly.

Portals can look into each other, so if a portal can see through another portal it will render what is in the zone (or at least some of it depending on where the player is in relation).

Anything that penetrates a zone will render. Individual objects are what get culled, so if you've got one big level as a single model it's always going to show (I can't remember if submeshes cull).

There's also a slight issue that culling can happen at certain acute angles even though your looking through a portal.

Portals are best used on doglegs, where the player can't see along them (90 degree angles in other words).
#2
04/18/2010 (8:14 am)
Ahh I think I see then. So in my case, since i just had zones in rooms and a portal in the door but no zone connecting to them, the portal must have just connected to anywhere that didn't have a zone (the hallways) which is why I could see it from an angle that didn't have a portal and couldn't see the other portal.

So to effectively use this, I should make another zone to connect to the other side of the portal so I can't see inside my first zone until I get into that second zone.

Thanks very much for the info!