Adobe Air 3?

Software: Away3D 4.x

3dNewb, Sr. Member
Posted: 25 December 2011 11:16 PM   Total Posts: 105

Simple question: Does Away3d 4 work with Adobe Air?

If I set up an Actionscript project in Flash Builder, it renders perfectly well in the browser.

If I set up an Desktop AIR app, it does nothing, no errors, just a white screen.

   

Avatar
mrpinc, Sr. Member
Posted: 26 December 2011 12:09 AM   Total Posts: 119   [ # 1 ]

yes it works with adobe air

Make sure you have set <rederMode>direct</renderMode> inside your application descriptor xml

   

3dNewb, Sr. Member
Posted: 26 December 2011 12:21 AM   Total Posts: 105   [ # 2 ]

Thanks for your reply.

I did actually have it set to “direct”, also tried “gpu” to no effect.

This following code should give me a big black viewport, right? Or am I adding it the wrong way with the UIComponent?

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
        
xmlns:s="library://ns.adobe.com/flex/spark" 
        
xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:local="*"  >
 

 
 <
fx:Script>
  <!
[CDATA[
   import away3d
.containers.View3D;
   
   
import com.dyteq.utils.flex.ImageSizeHelper;
   
   private var 
view:View3D;
   
   protected function 
application1_addedToStageHandler(event:Event):void
   {
    
    view 
= new View3D();
    
view.backgroundColor 0;
    
comp.addChild(view);
   
   
}
   
   
protected function windowedapplication1_enterFrameHandler(event:Event):void
   {
    
    
if(view{
     trace
('render');
     
view.render();
    
}
   }
   
  ]]
>
 </
fx:Script>
 
 <
mx:UIComponent id="comp" width="100%" height="100%" addedToStage="application1_addedToStageHandler(event)" enterFrame="windowedapplication1_enterFrameHandler(event)"/>

 
</
s:WindowedApplication
   

Wouter VdB, Newbie
Posted: 27 December 2011 12:18 AM   Total Posts: 3   [ # 3 ]

Are you using a special window skin that does not draw a background?

If not, then this is probably your problem. The Stage3D is drawn behind the regular display list, which includes the background in the default window skin. To solve: copy spark.skins.spark.WindowedApplicationSkin, remove the ‘backgroundRect’, and use this custom skin for your WindowedApplication.

Edit: alternatively you can set the ‘backgroundAlpha’ CSS property of WindowedApplication to 0.

Best.

   

3dNewb, Sr. Member
Posted: 27 December 2011 05:18 PM   Total Posts: 105   [ # 4 ]

Yes, it works now! Thanks a lot!

   

tcorbet, Jr. Member
Posted: 27 December 2011 06:23 PM   Total Posts: 31   [ # 5 ]

I would be interested in knowing whether either poster can successfully view any Stage3D content in the Window component if that Window’s transparency property is set true.  [Usually because the application not only has its own specialized skin, but because the window is non-rectilinear in shape.]

If so, please let me know what the actual rendering mode is—not what you specified, but what was actually used by the returned Context3D.

Thank you.

   

Wouter VdB, Newbie
Posted: 28 December 2011 08:33 AM   Total Posts: 3   [ # 6 ]

When setting transparent to true and renderMode to ‘direct’, then once the creation of the window is complete, the renderMode property of the window remains ‘direct’. I don’t know how to get the rendering mode actually used by the Context3D, as you requested. The Context3D’s driverInfo is ‘OpenGL (Direct blitting)’.

   

tcorbet, Jr. Member
Posted: 28 December 2011 06:11 PM   Total Posts: 31   [ # 7 ]

Wouter,

Thank you for taking a look at the combination. In my test case for the bug, I have been relying on the away3d.debug.AwayStats class to accurately display the state of the 3D context, since I have it plugged into most demonstrations for reporting frame rates and memory leaks anyway. If you don’t want to klutz up what you are working on with the AwayStats object on the stage, maybe you would so kind as to just stick something like this into your render loop:


trace (view.renderer.stage3DProxy.context3D.driverInfo);

For me, leaving all other states/conditions/properties the same, but merely changing to Window.transparency = true, from Window.transparency = false, is sufficient to cause the driverInfo to change to software from hardware.

It’s difficult, however, to get the folks responsible for fixing the bug to work on it, because [even before Apache], they have the idea that you vote on whether or not to fix what is broken.  Since there are evidently not enough developers who think it is helpful to render 3D content in windows shaped like Christmas Trees, or Valentines, or Easter Eggs, the voting mechanism leaves my bug unattended.  That’s my selfish motivation for enlisting your aid in confirming the bug.

   

Wouter VdB, Newbie
Posted: 30 December 2011 08:02 AM   Total Posts: 3   [ # 8 ]

For me, when setting transparent = ‘true’, the driverInfo remains ‘OpenGL (Direct blitting)’.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X