Game Development Community

Distance-dependent Portals?

by Daniel Buckmaster · in Torque 3D Professional · 01/26/2012 (5:19 am) · 0 replies

I just had an idea, thinking about portalising a level I'm working on. With things like windows into a building (in this case, a boat), what if we could stop them from acting as portals above a certain distance away? Using LOD stages, an opaque window mesh could replace transparent glass, but as you approach, you'd be able to see inside. To make it worthwhile not just from an artistic point of view, we'd need some way to block a portal until the camera was close enough to it. Could this be done with Portals?

I'll do a test at some point, but I'm thinking a small check could be added in Portal::traverseZones. I'm just not sure how to go about using the SceneTraversalState* that is passed.

About the author

Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!