(solved) Away3D 4 Beta problem when export app on ipadHD

Software: Away3D 4.x

Skyrick, Jr. Member
Posted: 18 March 2012 09:16 PM   Total Posts: 34

I’ve tried to export a basic app but I’ve a “White Screen” problem..
My configuration : MacPro / Lion with iPad3 Device, FlashBuilder 4.6, AIR 3.2

My steps are
Create a AS Mobile Project
Set Flex 4.6 Sdk with AIR 3.2
Add direct in the renderMode
Add the source code of a simple sphere red.

package
{
 import away3d
.containers.View3D;
 
import away3d.debug.AwayStats;
 
import away3d.entities.Mesh;
 
import away3d.materials.ColorMaterial;
 
import away3d.primitives.SphereGeometry;
 
 
import flash.display.Sprite;
 
import flash.events.Event;
 
import flash.display.StageAlign;
 
import flash.display.StageScaleMode;
 
 
[SWF(frameRate "60"backgroundColor "#000000"width "896"height "520")]
 
public class Main extends Sprite
 {
  
private var view:View3D;
  private var 
_statsAwayStats;
  
  public function 
Main()
  
{
   stage
.align StageAlign.TOP_LEFT;
   
stage.scaleMode StageScaleMode.NO_SCALE;
   
   
view = new View3D();
   
addChild(view);
   
   
//var view:View3D = new View3D();
   
view.100;
   
view.100;
   
view.width 200;
   
view.height 200;
   
view.backgroundColor 0xFFFFFF;
   
   
// Setup Away3D stats
   
_stats = new AwayStats();
   
_stats.5;
   
_stats.5;
   
_stats.scaleX 2;
   
_stats.scaleY 2;
   
this.addChild(_stats);
   
   var 
sphereGeometry:SphereGeometry = new SphereGeometry(350);
   var 
sphereMaterial:ColorMaterial = new ColorMaterial0xff0000 );
   var 
mesh:Mesh = new Mesh(sphereGeometrysphereMaterial);
   
   
view.scene.addChild(mesh);
   
addEventListener(Event.ENTER_FRAMEonEnterFrame);
   
  
}
  
  
private function onEnterFrame(event:Event):void
  {
   view
.render();
   
removeEventListener(Event.ENTER_FRAMEonEnterFrame);
  
}
 }

So, Works good on the emulator but white screen on the device.
Note1 : I can see the away stats graph on the device
Note2 : I tried a little Starling Project and it works good with the device

Thanks for your help,
Skyrick

   

Avatar
Fabrice Closier, Administrator
Posted: 18 March 2012 09:19 PM   Total Posts: 1265   [ # 1 ]

can you post your app.xml please
sounds like its missing the stencil tag

 

   

Skyrick, Jr. Member
Posted: 18 March 2012 09:29 PM   Total Posts: 34   [ # 2 ]
Fabrice Closier - 18 March 2012 09:19 PM

can you post your app.xml please
sounds like its missing the stencil tag

of course but too long, I send it on attached file.

And I don’t have any Stencil on :(
(sorry I’m noob)

 

File Attachments
Main-app.xml  (File Size: 11KB - Downloads: 262)
   

Avatar
Fabrice Closier, Administrator
Posted: 18 March 2012 10:11 PM   Total Posts: 1265   [ # 3 ]

Add this ligne in node “initialWindow”
<depthAndStencil>true</depthAndStencil>

oh and if you target IPad 3, add this one to your IPhone node
<requestedDisplayResolution>high</requestedDisplayResolution>

 

   

Skyrick, Jr. Member
Posted: 19 March 2012 06:42 PM   Total Posts: 34   [ # 4 ]
Fabrice Closier - 18 March 2012 10:11 PM

Add this ligne in node “initialWindow”
<depthAndStencil>true</depthAndStencil>
oh and if you target IPad 3, add this one to your IPhone node
<requestedDisplayResolution>high</requestedDisplayResolution>

I’ve a change with the add of line <depthAndStencil>true</depthAndStencil>

On the Ipad, I’ve now only Stats (not mesh again) but Stats are ... empty ...
(see first attached file)

On the emulator, I cans see the red sphere on white scene
(attached file n°2 - Emulator00)

 

   

Skyrick, Jr. Member
Posted: 19 March 2012 07:19 PM   Total Posts: 34   [ # 5 ]

If I add “-locale en_US -swf-version=13” I’ve the same things

And with “-locale en_US -swf-version=15” I’ve this error on the emulator :

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/XXXX/FlashBuilder/WorkSpace/3DTest01/away4/src/away3d/core/managers/Stage3DProxy.as:226] 

Please help

 

   

artpluscode, Newbie
Posted: 20 March 2012 04:17 PM   Total Posts: 8   [ # 6 ]

Hi Skyrick,
I just tried your code here.. couple of things I noticed:

_stats = new AwayStats(view); 

You need to pass the view instance into the AwayStats constructor like this so it knows what view to show stats for.
Alos, in your onEnterFrame event handler you are removing the enterFrame event listener so you will only ever get one frame rendered. Try this:

private function onEnterFrame(event:Event):void
  {
   view
.render();
   
//removeEventListener(Event.ENTER_FRAME, onEnterFrame);
  

I ran it here (OS X, Flash Builder 4.6, AIR 3.2, iPad 2) and it shows up correctly.

HTH

 

   

Skyrick, Jr. Member
Posted: 20 March 2012 06:16 PM   Total Posts: 34   [ # 7 ]

Hi artpluscode,

You’re great ! You’re absolutely right : all works fine now !
(see attached file)

Thank you SO much !:

But one question : Why the emulator worked well with the wrong code ? mad

 

   

artpluscode, Newbie
Posted: 20 March 2012 06:44 PM   Total Posts: 8   [ # 8 ]

My guess is that when the first (and only) render cycle is being run in your original movie the iPad is not quite ready to draw anything to screen so you never see anything. Whereas in the simulator the first render is being drawn. Maybe to do with machine speed or the way GPU works on the different platforms. But that’s just a guess.

I have been having similar problems with one of my projects which is how I happened on your post. I’ll let you know if I get to the bottom of it!

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X