How to hide stage and stop 3D GPU processing temporarily without disposing?

Software: Away3D 4.x

Sean72, Newbie
Posted: 24 July 2013 11:46 PM   Total Posts: 28

Hi,

I have been working on an interface that will have both a video playback function and an Away3D function but not at the same time.  I would like to be able to ‘turn off’ and/or hide the Away3D layer while the video is playing and then turn it back on at will.

I have tried

View3D.visible = false

which ‘hides’ the 3D stage quite neatly, but a GPU monitor shows it is still processing the Away3D view, almost as much if it were still visible.  For my computer, it isn’t a problem, but I know there are machines in the intended user base that will not be happy to both play video and process Away3D at the same time.

There is a fairly large AWD file being loaded to set up the Away3D layer and I was hoping not to make the browser reload and rebuild the view every time I swap views.  Does someone know of a way to do this?

   

lior_hai, Newbie
Posted: 25 July 2013 07:18 AM   Total Posts: 10   [ # 1 ]

What I would do is just hide the view with another sprite witch will be drawn on top of the view by default.

To reduce GPU processing I would just stop the ENTER_FRAME function used to render the view.

private function pause_view():void
{
    this
.removeEventListener(Event.ENTER_FRAMEonFrameHandler);
}

private function resume_view():void
{
    this
.addEventListener(Event.ENTER_FRAMEonFrameHandler);
}

private function onFrameHandler(event:Event):void
{
    view
.render();

This will stop the rendering process and will ease on the GPU usage.

 

   

Sean72, Newbie
Posted: 25 July 2013 02:48 PM   Total Posts: 28   [ # 2 ]

Awesome, I’ll try that, thank you.

   
   
‹‹ Ambient Light

X

Away3D Forum

Member Login

Username

Password

Remember_me



X