Page 1 of 1

Loading and unloading scene

Posted: 02 Feb 2014, 23:16
by Robert
Hi,

It's a question I wanted to ask since a long time.
Working on huge projects I use a lot of scene port. Usually I load and unload scene port. To unload the scene I pass an empty URL to the scene port. In async mode it seems to be ok. Is it the good way to do? I understood the resource manager constraint.
Why there's no Boolean value to load or unload this scene port directly on the scene port. Most of the time only blocking the scene port is not enough if we talk about performance.
Why unloading scene is blocking the designer even if async value is checked?

R

Re: Loading and unloading scene

Posted: 03 Feb 2014, 12:04
by Karol
Hi Robert,

If you just want to save performance, it's enough to block the Scene Port node. This has the same performance gain as if you would unload the scene.
If you want to save performance AND memory, you have to unload the scene from the Scene Port by setting an empty URL to the 'Scene' property.
There is no 'Unload' command because the 'Scene' property defines the state of the node. An additional 'Unload' could conflict with the 'Scene' property value.

The cause why Ventuz is blocking even if the Scene Port is in Async mode is .Net! If we release a scene asynchronously the .Net Garbage Collector will start to clean up the memory and free resource.
Unfortunately it has to stop the whole process to have a defined state of the memory for clean-up.
Hope this clarifies some things.

Best Regards
Karol

Re: Loading and unloading scene

Posted: 03 Feb 2014, 12:23
by Robert
Ok it's clear.

I made a test loading a scene without any content inside but Director log this: took 16ms to activate and may caused rendering stalls.
How is it possible since this scene is empty?

Does nested scenes inherit from the async properties of the parent scene? Or is it a better way to define explicitly the async properties for each.

R

Re: Loading and unloading scene

Posted: 04 Feb 2014, 10:49
by Karol
The rendering stall for an empty scene is strange - I will check this.
If you load a scene asynchronously via Scene Port and this scene has Scene Ports again everything is loaded asynchronously, no matter if these inner Scene Ports are set to async mode or not.

Cheers
Karol