Air <s:Window depthAndStencil error but <s:WindowedApplication is ok

Software: Away3D 4.x

mani, Newbie
Posted: 13 July 2012 05:35 AM   Total Posts: 6

The depthAndStencil flag in the application descriptor must match the enableDepthAndStencil Boolean passed to configureBackBuffer on the Context3D object.

Hi, guys, I just want to use away3D in my air window.
In WindowedApplication I can set “depthAndStencil” in it’s description.xml.
But in Window , there is no xml file, I can set <s:Window renderMode=“direct”, but can’t set depthAndStencil=“true”.
I just found that’s caused by -swf-versi but I want to use bitmapdata.encode method, so swfVersion must be 16, anybody know how to make both work?

Thanks for your time, guys!

   

Avatar
Fabrice Closier, Administrator
Posted: 13 July 2012 08:40 AM   Total Posts: 1265   [ # 1 ]

Not sure I get your problem 100%...
But if you apply the 2 following “tips”, your problem(s) might be solved.

the app.xml
The mainapplication, does use the app xml.
make sure that you have the following set propperly:
to support the swf version 16, you must use 3.3 or higher
<application >
to have Away3D/Stage3D
add to the <initialWindow> both tags
<renderMode>direct</renderMode>
<depthAndStencil>true</depthAndStencil>

The new Window
One common (wrong) assumption is to expect that each new window that you create within your app, will automatically inherit all your native app window properties (defined in app.xml). When it comes to rendermode it doesn’t.
So if you want an Away3D view or any Stage3D API rendering in a new window within your app, you have to again to set the renderMode.

var options:NativeWindowInitOptions = new NativeWindowInitOptions();
options.systemChrome = NativeWindowSystemChrome.STANDARD;
options.type = NativeWindowType.NORMAL;
 
options.renderMode = “direct”;  //<—- without this one: no Stage3D

Hope it helps

   

mani, Newbie
Posted: 13 July 2012 09:04 AM   Total Posts: 6   [ # 2 ]

Thank you very much, Fabrice!

I’m using AIR 3.3, and the problem hasn’t solved. I have set

<renderMode>direct</renderMode>
<
depthAndStencil>true</depthAndStencil

but if I set -swf-version = 16, error is out:

ErrorError #3709: The depthAndStencil flag in the application descriptor must match the enableDepthAndStencil Boolean passed to configureBackBuffer on the Context3D object.
 
at flash.display3D::Context3D/configureBackBuffer()
 
at away3d.core.managers::Stage3DProxy/onContext3DUpdate()[/Users/mani/Documents/java/away3d 4.0/Away3D/src/away3d/core/managers/Stage3DProxy.as:232] 

I just set -swf-version=13 to make it work.

And I just encountered a new problem about get 3d bitmap:

view3d.renderer.swapBackBuffer=false;
view3d.render();
view3d.stage3DProxy.context3D.drawToBitmapData(bd);
view3d.renderer.swapBackBuffer=true

When I call it after the mesh added, it works fine. But after a while, it return a white bitmap, I use this:

public function getSceneBitmapData():BitmapData
  {
   
var bd:BitmapData=new BitmapData(view3d.widthview3d.height);
   
view3d.renderer.swapBackBuffer=false;
   
view3d.render();
   
view3d.stage3DProxy.context3D.drawToBitmapData(bd);
   
view3d.renderer.swapBackBuffer=true;
  

Thanks again!

 

   

Avatar
Fabrice Closier, Administrator
Posted: 13 July 2012 09:22 AM   Total Posts: 1265   [ # 3 ]

Would you mind try again using the “release” branch (the to become 4.0)
In beta there is a bug (fixed in release) that was generating this error in AIR.

   

3dNewb, Sr. Member
Posted: 13 July 2012 09:51 AM   Total Posts: 105   [ # 4 ]

Related to this issue?
http://away3d.com/forum/viewthread/1976/

   

mani, Newbie
Posted: 13 July 2012 10:21 AM   Total Posts: 6   [ # 5 ]

Thanks, guys, It worked, just call view3d.render(); http://away3d.com/forum/viewthread/1976/P15

private var _view:View3D;

_view = new View3D();
_view.backgroundColor 0x222222;
_view.antiAlias 4;
_context.addChild(_view);
_view.render(); 
   
   
‹‹ Baking UV texture

X

Away3D Forum

Member Login

Username

Password

Remember_me



X