[Logo]
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing  
[Register] Register / 
[Login] Login 
stage3D content disappears if render in software mode and go full screen  XML
Forum Index » Alternativa3D 8
Author Message
wanglz


Joined: 25/12/2011 07:36:11
Messages: 44
Offline

If I made my app runs in software mode by change Flash Player setting or using Stage3D unsupported hardware, and every time I changed to full screen mode, the stage3D content disappears.
I tried Alternativa Demos and most of versions of Flash Player 11, this always happens.
Do you guys know something about this?
wanglz


Joined: 25/12/2011 07:36:11
Messages: 44
Offline

I've been working on this issue and I finally found out what happened.
Since the app used software mode, when going into full screen for the first time, the context3D will be dispose once and then dispatch Event.CONTEXT3D_CREATE event once. But if you use directX render mode, this won't happen.
Besides this, the problem is still there: when Event.CONTEXT3D_CREATE event was dispatched again, all the resources in root container of Object3D are tagged as uploaded. If I force to upload them, seems they won't render correctly anway.
Would please someone look into this?
wanglz


Joined: 25/12/2011 07:36:11
Messages: 44
Offline

There are something more FYI.
If I use simple AGAL code to build a test app, this also happen but will work fine after complete CONTEXT3D_CREATE event listener function. But if I use Alternativa3D, I tried to built and upload everything in that function, and I can see there are triangles in camera.diagram, the view shows nothing but black background.
wanglz


Joined: 25/12/2011 07:36:11
Messages: 44
Offline

Now I found out that if I call the context3D.dispose() function while using Alternativa to manage all resources, the 3D view could not to be redraw correctly whether in software mode or hardware mode.
Flash will dispatch another CONTEXT3D_CREATE event after dispose function which may be called for plenty of reasons. See this:

Important note on device loss: GPU device loss occurs when the GPU hardware becomes unavailable to the application. The Context3D object is disposed when the GPU device is lost. GPU device loss can happen for various reasons, such as, when a mobile device runs out of battery power or a Windows device goes to a "lock screen." When the GPU becomes available again, the runtime creates a new Context3D instance and dispatches another context3DCreate event. Your application must reload all assets and reset the rendering context state whenever device loss occurs.

Design your application logic to handle the possibility of device loss and context regeneration. Do not remove the context3DCreate event listener. Do not perform actions in response to the event that should not be repeated in the application. For example, do not add anonymous functions to handle timer events because they would be duplicated after device loss. To test your application's handling of device loss, you can simulate device loss by calling the dispose() method of the Context3D object.

The following example illustrates how to request a Context3d rendering context:

if( stage.stage3Ds.length > 0 )
{
var stage3D:Stage3D = stage.stage3Ds[0];
stage3D.addEventListener( Event.CONTEXT3D_CREATE, myContext3DHandler );
stage3D.requestContext3D( );
}

function myContext3DHandler ( event : Event ) : void
{
var targetStage3D : Stage3D = event.target as Stage3D;
InitAll3DResources( targetStage3D.context3D );
StartRendering( targetStage3D.context3D );
}


But I can not find a way to write this two function using Alternativa: InitAll3DResources( targetStage3D.context3D ); StartRendering( targetStage3D.context3D );
Need some help here! Ouch!
 
Forum Index » Alternativa3D 8
Go to:   
Powered by JForum 2.1.8 © JForum Team