Author Topic: Pause scene freezes display list - iOS & Android  (Read 199 times)

J Castellano   «   on: June 20, 2012, 01:05:50 PM »
Hello,

I'm in the middle of developing an iOS app and a website using flare3D to make a game.  On the desktop version using the pause method works perfectly.  Its stops the 3D game and allows me to work with the display list.  On mobile, it freezes the whole game's display list too!  Buttons still work and when I click through I can restart the game by hitting the 'invisible'/'frozen button.  Is this a bug on mobile?  Can it be worked around? 

Ivan Vodopiviz   «   Reply #1 on: June 21, 2012, 12:02:46 PM »
Hi,

This isn't a bug in Flare3D, it's actually Flash's behavior in mobile, mostly because GPUs tend to be less powerful there. In mobile, DisplayList update is tied to Stage3D, so if you stop updating Stage3D by pausing  the scene, it will also stop updating DisplayList.

You might be able to solve this by manually calling: scene.context.present(); You might need to call scene.context.clear(); before presenting the context.

Cheers,


J Castellano   «   Reply #2 on: June 23, 2012, 02:37:44 PM »
I haven't been able to figure this out.  Are you saying I can get back to the display list if I do something like this?

function pauseSceneBackToFlash()
{
    scene.pause();
    scene.context.clear();
    scene.context.present();
}

Or do I have to manage my enter frame event manually?

function render3DFrame(MouseEvent=null):void
        {
                if ( !scene.context ) return;
                Input3D.update(); // if you want to use the Input3D class.
                scene.update(); // updates all the scene animations.
                scene.setupFrame(); // sets some global variables to use during the frame render..
                scene.context.clear(); // clear the back buffer.
                scene.render(); // render the entire scene (you can draw here individual objects)
                scene.context.present(); //
        }

We're using a commercial license here and building for a high profile client but we're struggling with iOS performance on iPhone 4.  Being able to pause the 3D scene for necessary other elements is critical.

Ivan Vodopiviz   «   Reply #3 on: June 25, 2012, 11:52:41 AM »
Yes, sorry, I should have been clearer. You're right though, I meant that you should manage your own enter frame event in this case. As I mentioned before, this is the standard behavior of Flash in mobile, not Flare3D's.