-
1. Re: GPU performance of old Packager & updated release of Packager
jmp808 Oct 17, 2010 6:49 PM (in response to artur (inarty))and this is using cacheAsBitmapMatrix?
-
2. Re: GPU performance of old Packager & updated release of Packager
artur (inarty) Oct 17, 2010 11:10 PM (in response to jmp808)No, I just use cacheAsBitmap for Sprites.
And also I tried to compile with GPU rendering diagnostics. All Sprites are green at the beginning of life and then from time to time all become reds for re-uploading to the GPU.
-
3. Re: GPU performance of old Packager & updated release of Packager
jmp808 Oct 18, 2010 2:47 AM (in response to artur (inarty))documentation says if you are changing alpha, rotation, scale or 3D properties of display objects then you need to be using cacheAsBitmapMatrix. this stops it having to be re-rendered in software. this is also in the optimization guideline document
"Note: The DisplayObject.cacheAsBitmapMatrix property available in AIR or the Packager for iPhone Preview does not have this limitation. By using the cacheAsBitmapMatrix property, an object can be rotated or scaled without any bitmap regeneration. This property ensures that the GPU is used to render the bitmap onscreen, which provides performance improvements"
http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36c11f3d612431904db9-7ffc.html
-
4. Re: GPU performance of old Packager & updated release of Packager
artur (inarty) Oct 18, 2010 4:10 AM (in response to jmp808)Many thanks for the help, but the performance was no more.
I added
var mc:Sprite = new demo();
var matrix:Matrix = new Matrix();
mc.cacheAsBitmapMatrix = matrix;
mc.cacheAsBitmap = true;
Result:
10 items - 10/11 fps
20 items - 6/7 fps
I also have the same problem with just 2d Motions without 3d.
I check the application on my iPod Touch 3g
Here is the sources http://www.sendspace.com/file/2spl6i
Can somebody try compile it with old & new Packager?
You need just to replace your PFI folder in Application folder with previous compiler version (Mac OS)
Previous PFI: http://www.sendspace.com/file/e24m82
-
5. Re: GPU performance of old Packager & updated release of Packager
jmp808 Oct 18, 2010 5:00 AM (in response to artur (inarty))try swapping your cache lines around.. i dont know it makes any difference, but I think you're meant to cache the bitmap first anyway
as per mike chambers example
var mc:Sprite = new demo();
mc.cacheAsBitmap = true;
var matrix:Matrix = new Matrix();
mc.cacheAsBitmapMatrix = matrix;
also look into optimizing your code: eg page 45 onwards here shows how to optimize variable allocation etc
http://www.slideshare.net/yagizgurgul/flash-iphone-fitc-2010
for instance you could make matrix a class variable and set matrix = new Matrix() once in your init function rather than call it every time you call addLoop.
private var matrix:Matrix
public function speedtest2() {
{
.. [etc ] ...
matrix = new Matrix();
}
public function addLoop() {
mc.cacheAsBitmapMatrix = matrix;
}
also do you specifically need to add items to sub? guidelines say "keep the display list shallow".. ie add the items to the stage if possible rather than a nested sprite.
-
6. Re: GPU performance of old Packager & updated release of Packager
artur (inarty) Oct 18, 2010 2:06 PM (in response to jmp808)Thank you a lot, but
I saw all this slides ...
I edited my code for better optimization ...
Here is no difference between swapping the cache lines ...
So, I have absolutely the same result. Updated GPU rendering in 4 times slowly.
I use the sub Sprite for showing the FPSCounter at the top of the stage. Here is now problem with this in previous packager.
I can't understand what is going on with GPU rendering. Somebody have the same problems?
here is the sources: http://www.sendspace.com/file/7sjhcb
Also i tried to create simple app without any script with only 3d animation of 20 cached Sprites. The result is same.
More slowly than before (((
-
7. Re: GPU performance of old Packager & updated release of Packager
jmp808 Oct 18, 2010 3:14 PM (in response to artur (inarty))do note that Tweener is known to be slow.. check these performance comparisons
http://www.be-interactive.org/works/20090428/Particle/index.html
http://www.be-interactive.org/works/20090911/Particle/index.html
try using BeTweenAS3 and see if you get better performance
one way of doing your code is this (although I don't know the API too well so it may not be the most optimal method)
var tween1:ITween = BetweenAS3.to(mc, { rotationX:90, rotationY:90 }, 2);
var tween2:ITween = BetweenAS3.to(mc, { rotationX:0, rotationY:0}, 2);
tween2.onComplete = doSomething;
tween2.onCompleteParams = [mc];
var allTweens:ITween = BetweenAS3.serial(tween1, tween2);
allTweens.play();
also using Tween engines like this is probably firing off multiple timers. you would probably be better implementing your own update loop that moves each sprite in one function over time.
I would have a look at some of Mike Chamber's code (pew pew & SimpleGameFramework) to see how an adobe flash programmer does it
http://github.com/mikechambers/
can you tell me how this performs in comparison? (just using my own basic update loop, no tweens at the moment)
-
8. Re: GPU performance of old Packager & updated release of Packager
artur (inarty) Oct 19, 2010 3:31 AM (in response to jmp808)I used your code. The result is the same ((
My FPS counter show me 6/7 FPS when I adding 20 items on the stage.
Here is the problem not with the script optimization. I used the same code in previous & new packager.
And in general here is no problems with scripting.
You can try just to add 20 rotated(3d) sprites in the timeline animation & you found the same result.
Very slow animation (( In 4 times slowly than before.
P.S. Thank you for BeTweenAS3. It looks very nice, really more faster in thousands of parallel animations.
-
9. Re: GPU performance of old Packager & updated release of Packager
artur (inarty) Oct 20, 2010 8:49 AM (in response to artur (inarty))Additionally i compiled the famous adobe DiceSample from the "Optimizing content for Apple iOS devices" post and it is looks very slowly with new packager ((( GPU looks just a little bit better than CPU.
Optimizing content for Apple iOS devices: http://www.adobe.com/devnet/flash/articles/optimize_content_ios.html
Download samples:
Please guys try to do compile it. Maybe I'm alone with this problem ((

