Fading with Zones
by Necrode · in Torque 3D Professional · 11/26/2009 (12:50 am) · 5 replies
Hello,
How would one go about having objects fade in/out when entering/exiting a zone instead of popping in and out as they do by default?
Thanks!
How would one go about having objects fade in/out when entering/exiting a zone instead of popping in and out as they do by default?
Thanks!
About the author
They locked me in here with a computer, and said I don't get to leave until I've completed a computer game.
#2
Is there even just a method of getting a list of all objects in a zone?
11/26/2009 (9:37 am)
I know, but the idea is that when you come into a zone it starts rendering the stuff in that zone (as per usual), but immediately sets the alpha to 0 and fades it in. Lots of games have this (particularly games with outdoor spaces).Is there even just a method of getting a list of all objects in a zone?
#3
11/26/2009 (11:39 am)
I believe there was a resource for one of the previous engines that did fading in/out at a specific distance. Shouldn't be too hard to adapt to the loader of a mesh...
#4
11/26/2009 (10:30 pm)
Thanks
#5
The zone system works by hooking directly in the scenegraph. The zones are traversed, starting from the one the camera is in, and through all others that are visible though connected portals. Any objects found in those zones are added to the list of things to be rendered, everything else is not. So, making objects fade out when they leave a zone would involve some low-level source code changes, since they would somehow need to continue to be rendered even when the camera is no longer in that zone.
It sounds you're doing something GTA-esque. A full custom approach to handle the culling and fading of objects would work better then trying to hack the zone system.
11/27/2009 (9:20 am)
Thing is, you are sort of misusing the zones. They aren't designed for having objects going in-out without crossing portals connected to them. They're not even meant to be used outdoors.The zone system works by hooking directly in the scenegraph. The zones are traversed, starting from the one the camera is in, and through all others that are visible though connected portals. Any objects found in those zones are added to the list of things to be rendered, everything else is not. So, making objects fade out when they leave a zone would involve some low-level source code changes, since they would somehow need to continue to be rendered even when the camera is no longer in that zone.
It sounds you're doing something GTA-esque. A full custom approach to handle the culling and fading of objects would work better then trying to hack the zone system.
Associate Rene Damm
Well, zones are not really designed for this. They are basically a scene optimization mechanism to reduce the number of objects rendered by the engine, i.e. they allow the engine to cull part of the object set. As such, this process is not meant to be visible to the user.