Which is faster for Cocos2d to draw / move / animate? A sprite made from a png image which is 50% opaque, or a sprite set to 50% opacity made from a png image which is 100% opaque?
Sprite Opacity Speed Question
(8 posts) (4 voices)-
Posted 1 year ago #
-
It doesn't matter, both render equally fast.
Posted 1 year ago # -
Thanks.
Posted 1 year ago # -
Good to know.
Does it matter if you draw multiple sprites in the same spot with 100% or 50% opacity (assuming that they all are in the same texture format like RGB4444)? And does the blend mode matter (additive vs. normal).Posted 1 year ago # -
Can't speak to the first part of your question, but I've heard additive blending is faster than normal.
Posted 1 year ago # -
Blending mode should not impact on performance, and neither should transparency. At least I can see no difference in performance.
That makes sense to me, as these things are handled by hardware.100% transparent pixels are faster to render though, probably because OGL can skip them early.
Posted 1 year ago # -
Transparent pixels can't be discarded, instead the GPU has to see if something lies beneath to get the correct color values. So there is no performance difference between 50 and 100 % transparency. Solid pixels on the other hand need less processing.
If you look at the blending equations then additive blending is slightly less complex than the standard blend function, so it'll be a bit faster.
Blending on a large scale (screen size) with multiple layers with transparency can surely affect performance. The hardware also has its limits, it's called fill-rate limited when that happens.
Posted 1 year ago # -
That's some usefull information. Thanks a lot!
Posted 1 year ago #
Reply
You must log in to post.