depthAndStencil value issue

Software: Away3D 4.x

FlexIncubator, Newbie
Posted: 28 February 2012 06:17 PM   Total Posts: 15

I am using the latest code form github and simple example from here:
http://www.adobe.com/devnet/flashplayer/articles/creating-games-away3d.html

Here is my code:
http://pastie.org/3481814

I am getting errors regarding wrong depthAndStencil value every time I am compiling the app. Setting this value (in app descriptor xml) either to true or false does not work.
When set to true, the error is:

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()[D:\Labs\AS3\HelloAway3DMobile\src\away3d\core\managers\Stage3DProxy.as:226] 

when set to false (which is the default):

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/configureBackBuffer()[D:\Labs\AS3\HelloAway3DMobile\src\away3d\core\managers\Stage3DProxy.as:119]
 at away3d
.containers::View3D/updateBackBuffer()[D:\Labs\AS3\HelloAway3DMobile\src\away3d\containers\View3D.as:460]
 at away3d
.containers::View3D/render()[D:\Labs\AS3\HelloAway3DMobile\src\away3d\containers\View3D.as:486]
 at HelloAway3DMobile
/this_enterFrameHandler()[D:\Labs\AS3\HelloAway3DMobile\src\HelloAway3DMobile.as:115] 

Leaving this value as false and modifying

updateBackBuffer() 

function in View3D.as (line 460) by setting hardcoded true to false fixes the issue. However, I guess this is not the way it should be done.

Could someone explain what this depthAndStencil is for, when it’s better to use it or not, pros and cons.
Thanks
Ilya

   

Abracad, Newbie
Posted: 29 February 2012 04:57 PM   Total Posts: 17   [ # 1 ]

hi,

if you’ve got the line <renderMode>direct</renderMode> in the xml file that describe your project you should also add <depthAndStencil>true</depthAndStencil>

if you’ve got <renderMode>gpu</renderMode> try to replace it with the 2 lines :
<renderMode>direct</renderMode>
<depthAndStencil>true</depthAndStencil>

Hope it will help

 

   

FlexIncubator, Newbie
Posted: 29 February 2012 04:59 PM   Total Posts: 15   [ # 2 ]
Abracad - 29 February 2012 04:57 PM

hi,

if you’ve got the line <renderMode>direct</renderMode> in the xml file that describe your project you should also add <depthAndStencil>true</depthAndStencil>

As i have mentioned - i tried to use both values, true and false. The error popups regardless of the value.

Also, I am using renderMode=direct. I believe this is the only value you should use to utilize Stage3d

 

   

Abracad, Newbie
Posted: 29 February 2012 05:05 PM   Total Posts: 17   [ # 3 ]

an xml file in attachment that works fine for ios ans android. At least for me…

don’t forget the -swf-version=13 as an additional compiler option (it should be 15 but it doesn’t work for me)

 

File Attachments
config_molehill.xml  (File Size: 2KB - Downloads: 802)
   

FlexIncubator, Newbie
Posted: 29 February 2012 05:28 PM   Total Posts: 15   [ # 4 ]

Dear, Abracad.
I understand you want to help, however, I think you did not read all my post very carefully -  I tried both valid values of depthAndStencil with just the same code. And both produced errors. I am not sure how your app.xml will help me. It just has values that I tried. Also, as I mentioned, i managed to make the app to work by changing the Boolean value in Away3D source code (however, I am not sure whether I did something good). I used -swf-version=15 with no problem (by specifying 13 you just target previous version, and not the latest one). My issue is that latest Away3D downloaded form github does not work with latest RC AIR 3.2 without modification of Away3D’s source. This is something I wanted to mention.

 

   

FlexIncubator, Newbie
Posted: 29 February 2012 05:33 PM   Total Posts: 15   [ # 5 ]

@Abracad
BTW, did you tried it on real devices or just in simulator? Indeed, setting -swf-version=13 made it working in simulator. However, it produced just the same error on real device.

 

   

Abracad, Newbie
Posted: 29 February 2012 05:39 PM   Total Posts: 17   [ # 6 ]

yes, it has be tested on real device (ipad1 and galaxy note) and works correctly.

i did read you post, but as i did spend most of my time yesterday to make it work and realise this morning that it was not working because of missing/wrong tags in the app descriptor…

anyway…

 

   

FlexIncubator, Newbie
Posted: 29 February 2012 05:50 PM   Total Posts: 15   [ # 7 ]
Abracad - 29 February 2012 05:39 PM

yes, it has be tested on real device (ipad1 and galaxy note) and works correctly.

i did read you post, but as i did spend most of my time yesterday to make it work and realise this morning that it was not working because of missing/wrong tags in the app descriptor…

anyway…

Is it possible that you create some very simple example (just put one cube on the stage), zip the whole project and attach it here. Also, just checking, whether you are using the RC of AIR 3.2 (because it was not mentioned) and the latest Away3D from github.

 

   

Fossor, Newbie
Posted: 29 February 2012 06:08 PM   Total Posts: 21   [ # 8 ]

Have you installed air 3.2 on the device?

 

   

FlexIncubator, Newbie
Posted: 29 February 2012 06:17 PM   Total Posts: 15   [ # 9 ]
Fossor - 29 February 2012 06:08 PM

Have you installed air 3.2 on the device?

As I have mentioned in my initial post - I was able to play the demo after some modification to Away3D source code. Which obviously means that I do have AIR installed at least on my PC. Also, something I forgot to mention, is that I am testing also on iPad 1. Again, it runs after modification to Away3D code. My question is whether we should always use depthAndStencil as true or false?

 

   

Fossor, Newbie
Posted: 29 February 2012 06:30 PM   Total Posts: 21   [ # 10 ]

I have not changed away3d code, only two parameters in application xml:
<renderMode>direct</renderMode>
and
<depthAndStencil>true</depthAndStencil>

I also have awaystats window:
addChild(new AwayStats(view));
Which says (on the device) that it runs under OpenGL

 

   

FlexIncubator, Newbie
Posted: 29 February 2012 06:44 PM   Total Posts: 15   [ # 11 ]
Fossor - 29 February 2012 06:30 PM

I have not changed away3d code, only two parameters in application xml:
<renderMode>direct</renderMode>
and
<depthAndStencil>true</depthAndStencil>

I also have awaystats window:
addChild(new AwayStats(view));
Which says (on the device) that it runs under OpenGL

This does not work for me. I always use direct mode and tried with both true and false.

 

   

FlexIncubator, Newbie
Posted: 29 February 2012 06:53 PM   Total Posts: 15   [ # 12 ]

I have found another, maybe more correct solution.
Assuming that we have to use depthAndStencil=true, there is a need of setting some default values in Stage3DProxy. _enableDepthAndStencil should be set to true. What is important is to set some default _backBufferWidth and _backBufferHeight, for example 320 and 480. These values will be updated later in the code to use the size of your app.
Then we should set depthAndStencil to true in app descriptor xml.

 

   

Fossor, Newbie
Posted: 29 February 2012 06:57 PM   Total Posts: 21   [ # 13 ]

Then, I guess something is not installed.
Here is my steps, for CS5.5:
1. Install AIR 3.2 Release Candidate on windows
2. Install AIR 3.2 Release Candidate on android device
3. Download AIR 3.2 SDK
4. Overwrite AIR 3.2 SDK http://www.youtube.com/watch?v=pwVkK27Nors flash version 13
5. I also copied AIR 3.2 SDK over flex 4.6 src folder - don’t know if this is necessary
6. Change publish settings to air for android
7. Change aplication.xml <renderMode>direct</renderMode> <depthAndStencil>true</depthAndStencil>
8. Publish

 

   

FlexIncubator, Newbie
Posted: 29 February 2012 07:13 PM   Total Posts: 15   [ # 14 ]
Fossor - 29 February 2012 06:57 PM

Then, I guess something is not installed.
Here is my steps, for CS5.5:
1. Install AIR 3.2 Release Candidate on windows
2. Install AIR 3.2 Release Candidate on android device
3. Download AIR 3.2 SDK
4. Overwrite AIR 3.2 SDK http://www.youtube.com/watch?v=pwVkK27Nors flash version 13
5. I also copied AIR 3.2 SDK over flex 4.6 src folder - don’t know if this is necessary
6. Change publish settings to air for android
7. Change aplication.xml <renderMode>direct</renderMode> <depthAndStencil>true</depthAndStencil>
8. Publish

This is really funny situation. Yesterday, i found the post of some other user on this forum, complaining that users who answer his initial question did not carefully read his question. Again, thanks for trying to help. However, I just wonder, based on what information you assumed that I did not install something. I have written several times that I was managed to get everything working (but just with some modifications to away3d core). As to your proposed steps. First of all, you are suggesting to install android specific stuff. However, i wrote that I am testing on iPad. Also, you should use -swf-version=15. Version 13 is for previous beta release.  As to setting renderMode and depthAndStencil - this was mentioned several times. Guys, please, do not post some general answers without understanding the problem. It will be much harder for all other users to find correct solution.

Anyway, I have found the solution and posted it above.

 

   

Fossor, Newbie
Posted: 29 February 2012 07:26 PM   Total Posts: 21   [ # 15 ]

Chill Winston, it’s me! smile
I just wrote my steps, you don’t have to use them, you may change the away3d code instead…

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X