Jump to content
Search Community

simple blitMask implement only 21fps ipad2

chunkdafunk test
Moderator Tag

Recommended Posts

Hi there, working in flash cs6 and compiling to air iOS 3.4 Im testing out blitmask with a speed var controlled from a variable. in the ADL im hitting 60fps but on device only getting 24?

 

At present I only have 1 movieclip on stage (mc) which is around 2000px in width, nothing else apart from fps monitor and buttons for speed control and a textfield for speed var.

 

import com.greensock.*;
import com.greensock.easing.*;
///
stage.addChild(new movieMonitor());
///
var bMask = new BlitMask(mc,0,0,stage.stageWidth,stage.stageHeight,true,true,0,true);
mc.cacheAsBitmap = true;
bMask.enableBitmapMode();
bMask.bitmapMode = true
///
var speed:Number = 10;
var dist:Number = 10;
var nums:Number = 1
mc.visible=false;
addEventListener(Event.ENTER_FRAME, loop);
function loop(e:Event):void
{
mc.x-=speed
speedText.text = speed.toString();
}
bubb1.addEventListener(MouseEvent.CLICK, dec)
bubb2.addEventListener(MouseEvent.CLICK, inc)
function dec(e:MouseEvent){
speed--
}
function inc(e:MouseEvent){
speed ++
}

 

I have seen the blitmask demo and the videos showing 60fps even on a iphone 3gs so I must be doing something wrong.

 

btw I am using GPU render (although I did try others)

 

Thanks

 

Phil

Link to comment
Share on other sites

Pretty tough to diagnose without seeing your file and publishing it, but I have a few questions:

  1. What FPS do you get if you DON'T use BlitMask and just use a regular mask instead? (or set bitmapMode to false)
  2. What FPS do you get if you turn off the GPU mode?
  3. Do you notice an improvement if you remove your TextField and FPS counter/display?
  4. Are you absolutely sure that you've got your file set to publish at 60fps?
  5. Can you post a very simple example FLA?

Link to comment
Share on other sites

Hi again just tested without text field and fps counter and get same fps approx. 21/24. I then removed the call to the draw the blitmask and the fps jumps to 60?

 

I was using a vector based mc (same as attached file) and thought that could be it so I replaced this with a bitmap but Im still getting the same low fps.

 

I am a little bit of a loss with what I am doing wrong? Any pointers would be great!

 

Thanks

 

Phil

Link to comment
Share on other sites

Hi all, just want some advice really on this if I am being unrealistic in what I am trying to do. I assumed after seeing the textfield/Blit video on YT that I should be able to blitmask/scroll a fullscreen background at (or around) 60fps on ios.

 

Can anyone advise on this as the attached file (i put up earlier in the thread) only contains the background and it is not even getting to 30 fps. If this is not possible then can someone flag just to put my mind at rest!

 

Many thanks

 

Phil

Link to comment
Share on other sites

It is indeed an odd anomaly, Phil, and I wonder if it has something to do with scaling for the retina display or something internally that Flash is having to do on-the-fly, but you said you're using an iPad 2, right? (which doesn't have a retina display)

 

I also wonder if iOS 6 or a newer version of Flash is rendering/compiling things differently in a way that doesn't handle BitmapData.copyPixels() or Graphics.beginBitmapFill() very well. I'll tinker a bit more, but I'm not seeing any obvious answers right now.

Link to comment
Share on other sites

Yeah, and keep in mind that the biggest performance boost you'll get is when you've got a DisplayObject that contains a lot of vectors or complex stuff that Flash must calculate and render on every frame. Your example was super simple (a bitmap with a few rectangles). If, on the other hand, you filled your mc with a bunch of text and/or vectors, I suspect you'd see the performance shift in favor of BlitMask.

 

Cheers!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...