Skip to main content
Participating Frequently
September 13, 2012
Question

iOS 6: problem with sprites rotation in gpu mode

  • September 13, 2012
  • 2 replies
  • 2689 views

Hi,

I have a game published on iTunes and today I found a serious problem with the latest iOS 6 GM.

Sprite rotation around X and Y axes doesn't work with gpu render mode.

Here is my code:

<mx:UIComponent id="gameCanvas" mouseChildren="false" mouseEnabled="false" width="100%" height="100%" />

...

var gridSprite:Sprite=new Sprite();

gameCanvas.addChildAt(gridSprite,0);

// then I draw stuff on this gridSprite

It works fine if this sprite is not rotated.

But when I change its rotationX or rotationY properties, the sprite disappears from the screen!

My game works fine on older versions of iOS (5.0, 5.1.1 and 6 beta 3).

This problem only happens on iOS 6 GM and since iOS 6 will be officially released in a few days, I am really worried...

I tried Air 3.3 and Air 3.4 - both have this problem.

In "cpu" and "direct" render modes sprite rotation works, but graphics performance is terrible. So "gpu" is my only option...

I'll really appreciate any help.

This topic has been closed for replies.

2 replies

Inspiring
September 20, 2012

I can confirm there is a problem with the 3d transformations. This objects also disappear if you use the "z" property.... even setting "z=0" will make it disappear

Participant
September 27, 2012

Hey Guys

Adobe has released Beta Air SDK 3.5 which fixes the 3D rotation issues in GPU mode! You can download it here:

    

     http://labs.adobe.com/downloads/air3-5.html

Reading through the further notes I have also found that they wont display a watermark if you decide to publish with the BETA sdk, so as long as you test your apps with ther runtime, go ahead and rebuild your projects with iOS6 support and fixed GPU rotation!

Thanks Adobe!

Inspiring
September 27, 2012

According to the release notes, they only mention a fix for "rotationY". Do you know if rotationZ, rotationX, and the Z properties work?

Colin Holgate
Inspiring
September 13, 2012

Doing 3D rotations will force the display object to be handled by the GPU. I wonder if you do something to make it be handled by the GPU, but you haven't done a cacheasbitmap, that the GPU doesn't have an image to manipulate?

dop2012Author
Participating Frequently
September 13, 2012

I set <renderMode>gpu</renderMode> in my application.xml

Also I did try setting gridSprite.cacheAsBitmap=true  - it doesn't fix  this problem and has no effect on performance.

Here is the video of my game, maybe it'll help somehow.

As I said, my code works fine on all older versions of iOS. So I'm afraid maybe this is some kind of a bug in the Air SDK?

dop2012Author
Participating Frequently
September 14, 2012

I performed some other tests and so it seems like everything is 2D in gpu mode. When I try to do 3D transformations, objects disappear from the view.

For example out of these 3 images only image1 is displayed:

<s:BitmapImage id="image1"  source="logo.png" height="25%" width="100%" />

<s:BitmapImage id="image2"  source="logo.png" height="25%" width="100%"  rotationY="5"/>

<s:BitmapImage id="image3"  source="logo.png" height="25%" width="100%"  z="5"/>

Maybe there is some setting that enables 3D (something like zBufferEnabled=true) that needs to be explicitly set for iOS 6 in gpu mode?

UPD: Ok, I'm pretty sure it's a bug, I reported it to Adobe - Bug 3330901