NME, cacheAsBitmap?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

NME, cacheAsBitmap?

singmajesty
I understand "cacheAsBitmap" in Flash Player.

Could someone explain what occurs in NME, under-the-hood, when you enable  
"cacheAsBitmap"? When do I want to use it?

Are there other "nice" things to know about NME rendering. For example,  
does adding to Stage perform differently than adding inside a Sprite?


Thank you!

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: NME, cacheAsBitmap?

Joshua Harlan Lifton
My understanding is cacheAsBitmap causes NME to use the software
renderer, which has at least two advantages I make regular use of:

1) Anti-aliasing. To my knowledge, there is no other way NME provides
for automatic anti-aliasing.
2) Correct filling of concave polygons. The software renderer avoids a
serious bug that the usual renderer exhibits when trying to fill
concave polygons.

Of course, the down side is that there is a significant performance hit.

Cheers,
JHL

On Mon, Aug 22, 2011 at 6:27 PM, Joshua Granick
<[hidden email]> wrote:

> I understand "cacheAsBitmap" in Flash Player.
>
> Could someone explain what occurs in NME, under-the-hood, when you enable
> "cacheAsBitmap"? When do I want to use it?
>
> Are there other "nice" things to know about NME rendering. For example, does
> adding to Stage perform differently than adding inside a Sprite?
>
>
> Thank you!
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: NME, cacheAsBitmap?

Gamehaxe
In reply to this post by singmajesty
NME will use the software render to create an opengl texture.
So you get the performance (bad) and the quality (good) of the software  
renderer.

HUgh

> I understand "cacheAsBitmap" in Flash Player.
>
> Could someone explain what occurs in NME, under-the-hood, when you  
> enable "cacheAsBitmap"? When do I want to use it?
>
> Are there other "nice" things to know about NME rendering. For example,  
> does adding to Stage perform differently than adding inside a Sprite?
>
>
> Thank you!

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: NME, cacheAsBitmap?

Tigga
It's important to note that cacheAsBitmap is NOT the same as using a Bitmap in the display tree. You can draw to the Bitmap's BitmapData using the draw command in the software renderer, but the Bitmap on the display tree won't need to redraw if transformed while the object with cacheAsBitmap will. You'll probably see a very slight quality improvement with cacheAsBitmap, but if you ever need to transform an object you'll get crippling slowdowns with cacheAsBitmap, whereas a smoothed Bitmap object will be fine.
Reply | Threaded
Open this post in threaded view
|

Re: NME, cacheAsBitmap?

Alex Liebert
In the few cases where I have vector graphics animated in my game, I've had the best results by 'precaching' them- bitmapData.draw()'ing them into a bitmap and storing it, and using that bitmap, instead of cacheAsBitmap on the vector source.

On Tue, Aug 23, 2011 at 10:27 AM, Tigga <[hidden email]> wrote:
It's important to note that cacheAsBitmap is NOT the same as using a Bitmap
in the display tree. You can draw to the Bitmap's BitmapData using the draw
command in the software renderer, but the Bitmap on the display tree won't
need to redraw if transformed while the object with cacheAsBitmap will.
You'll probably see a very slight quality improvement with cacheAsBitmap,
but if you ever need to transform an object you'll get crippling slowdowns
with cacheAsBitmap, whereas a smoothed Bitmap object will be fine.


--
View this message in context: http://haxe.1354130.n2.nabble.com/NME-cacheAsBitmap-tp6714454p6717109.html
Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org