flash - Are actionscript bitmaps faster than vectors? -
i'm working on project draws circles continuously @ framerate , animates them around stage , i'm running performance issues.
i'm converting objects bitmapdata become static. question is, converting circles bitmapdata drawn increase performance? in other words, animating say, 200 bitmaps (with transparency) faster 200 vector circles?
are there drawbacks technique? (i'm thinking opacity problems maybe?)
if more complex shapes circles answer different?
any other tips on improving performance?
thanks lot!
there several approaches might consider here:
bet on vector renderer drawing lines , circles each frame. they'll re-rendered every time, that's flash heavily optimized for, it's not impossible faster alternatives. (note drawing objects @ different sizes each frame might faster drawing them each
sprite, changing size.)bet against vector renderer moving bitmaps around. simple way (assuming you're drawing shapes as3) draw shapes
bitmapobjects , move around. may not happy jagginess of result. enabling bitmap smoothing (but cost performance).
note:cacheasbitmapnot want here, because cached bitmaps redrawn when object changes size (not sure transparency).bet on hardware acceleration using cacheasbitmapmatrix. available in air, may not work you. cabm similar cacheasbitmap, doesn't redraw contents rescale. further, in many cases bitmap gets handed hardware, , can rescaled on gpu. believe there platforms doesn't work though. fast, on mobile devices.
bet on as3 bitmap handling blitting stuff stage-sized bitmapdata. note if this, you'll still need decide whether draw shapes big bitmap each frame (like option 1) or draw them individual bitmaps , blit (transformed) big bitmap each frame (like option 2).
i don't think there's way know option best without experimenting. i'm option 3 best if you're using air , if hw acceleration works on platform, may not true. gut instinct option 4 not terribly helpful. blitting can fast when drawing lots of of static bitmaps onto stage untransformed, in case need either generating or transforming content each frame, guess benefit of blitting not occur bottleneck is. best guess option 2 faster 1, may not happy visuals.
Comments
Post a Comment