3 Replies Latest reply on Dec 3, 2007 6:34 AM by ChristopherCesarz

    transparency and performance

    Force_Code Level 1
      I have an image with an alpha channel containing per-pixel transparency info (The alpha channel is determined originally by a formula based on the RGB channels). The image scrolls in front of a background and the background is transparent correctly based on the alpha channel of the image, and there is no degradation in performance whatsoever (over what you would get with no transparency).

      I want to add one feature to the above, but have been unable to do so without immediate drop off in performance and refresh rate. Namely, I want to combine the above scrolling image with one which has the inverse of the above alpha channel applied on the same image but against a different background.

      This seems to be approximated by giving the original image a blendmode of Blendmode.ERASE, making the original background BlendMode.LAYER, and putting the new background behind the original background. So, the new background is partially transparent through the original background. This does work, but its WAYYY to slow, which is strange to me, because there is no performance hit at all with the original transparency set up.

      I've tried to accomplish it as well using masks, but that's too slow as well. Also CopyPixels, which actually gives me the precise visual effect I was looking for, but is even slower than the other methods.

      Is there anything else I can try.