开发者

Complex mask draws corrupted shapes

I assign a mask to a simple MovieClip with a square Bitmap in it. The mask is fairly complex shape drawn by an artist. The resulting masked bitmap looks correct inside Flash CS5, but when I run the SWF in Flash Player 10.2, the mask is corrupted. Let me try and describe it:

The shape itself is mostly visible, but certain scan lines (horizontal lines) of the resulting image "leak" to the right of the mask shape, all the way to the right border of the square bitmap. Some lines are also missing. Here's an image:

Complex mask draws corrupted shapes

The shape on the left is the mask used for the cracked bitmap, which you can see on t开发者_JAVA百科he right, masked, with flaws.

Are there some limitations that we should be aware of when using masks? Does flash only handle simple shapes for masking?


Have you tried to set both the mask and masked content to be cached as bitmaps?

Latest versions of Flash CS5 use Flash Player in design time to show its own content, so if it shows the mask as it should be, something must be happening behind the curtain.


I ended up just creating a Pixel Bender shader filter to do it instead, because then you can just copy the alpha from the source pixel to the destination pixel, and blend another texture into the source image however you see fit. Performance is not bad, as you can cache it all as a bitmap.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜