Question about cacheAsBitmap


#1

With the new cacheAsBitmap option, is it possible to force the renderer to not redraw while scaling a flattened Sprite/MovieClip? So you basicly get the same performance as scaling a single bitmap?

Right now, scaling a large nested complex movieclip seems to be very expensive and results in a very low FPS.


#2

I believe scaling is triggering a redraw. Do you know if cacheAsBitmap on Flash redraws on scale? Is cacheAsBitmapMatrix required to get the behavior you want? (it is not implemented outside of Flash yet, but it could be)


#3

I do believe cacheAsBitmap also forces a redraw when scaling on flash. However the render cost is lower. cacheAsBitmapMatrix blocks redrawing on flash so that is the desired result. However; this is as far as I know only implemented on mobile yet.

So an implementation of cacheAsBitmapMatrix that would work on desktop also would indeed produce the behavior I’m looking for :blush:


#4

How hard do you think it would be to get cacheAsBitmapMatrix working on the desktop targets?


#5

I think we need to continue to do testing on the caching algorithm in place, first. Once that’s stable, supporting cacheAsBitmapMatrix probably won’t be terribly complicated


#6

Could cacheAsBitmap not trigger a redraw when scaled if openfl-disable-graphics-upscaling is enabled? Wouldnt that be the correct behaviour?


#7

Umm, I’m not sure. That define is meant for logic around the shape.graphics vector rendering, but perhaps we should cause it to apply to both


#8

Yes, that makes sense in my opinion! :slight_smile: