Page 1 of 1

Flash AS3: why won't Inverted masks work? (BlendMode.ERASE)

Posted: Mon Mar 21, 2011 01:28
by Traxus
**Edit:
Okay, I was able to solve the requirements of my application by using layer blend modes (50 mask)... This will work in simple scenarios like the one I had but I can imagine situations where this issue would become a limiting factor, so the devs might want to read on:
**/Edit

I've been working on a project that utilizes inverted masks, meaning that everything the mask covers is actually displayed.

This involves the use of blend modes, specifically BlendMode.ERASE

this site has a pretty good tutorial on the matter:

http://code.radiesel.com/examples/InvertedMask_AS3/

You'll notice that if you download the swf, and run it on its own, the inverted mask (on the right) will display correctly, however if you import this swf into resolume, the normal mask on the left displays correctly, but the inverted mask on the right stops working and fills the would be masked area with black...

Is this a short coming of resolume? Please tell me there is a way around it...

http://code.radiesel.com/examples/Inver ... edMask.swf

Also**

I tried adding another layer beneath the inverted mask, the inverted mask will function in resolume so long as there is something beneath it in the actual flash file, but it will not display whatever the next layer in resolume is showing through this mask...

I even got clever, and made a .png that had some transparency, and placed this under the inverted mask, all of the non transparent parts show up fine, but the transparent parts of the png just default to black again, almost like it's assuming the swf has a solid black background when using blend modes...

Re: Flash AS3: why won't Inverted masks work? (BlendMode.ERASE)

Posted: Thu Mar 24, 2011 11:57
by Joris
Hey Traxus

I just tried the Flash file you linked to, and as far as I can make out, it's acting like it's supposed to, on every blend mode. But perhaps I'm misunderstanding the issue?
InvertedMaskScreenshot.png
InvertedMaskScreenshot.png (172.36 KiB) Viewed 19168 times
Joris

Re: Flash AS3: why won't Inverted masks work? (BlendMode.ERASE)

Posted: Fri Mar 25, 2011 20:06
by Traxus
Weird... is it my video card? I've got a pretty beefy one, gig of ram, ATI moblity Radeon 5870...


Image

Re: Flash AS3: why won't Inverted masks work? (BlendMode.ERASE)

Posted: Mon Mar 28, 2011 19:07
by edwin
Ahh suddenly something comes to mind. It has something todo on how text fields and transparency work in Flash. Joris was testing in OSX and that works like expected. So it's a Flash/Windows related bugs.

Re: Flash AS3: why won't Inverted masks work? (BlendMode.ERASE)

Posted: Tue Mar 29, 2011 03:44
by Traxus
huh, can someone try this? Its basically a clone of the Stripper effect, this is what initiated the discussion...

http://www.shyid.com/misc_upload/Rectangler.swf

Re: Flash AS3: why won't Inverted masks work? (BlendMode.ERASE)

Posted: Wed Mar 30, 2011 10:49
by Joris
Can you elaborate a bit on what we should be looking for? On OSX this clip shows me black and white fully opaque, and the red parts are transparent. Is that what it should look like?

Cool clip BTW.

Re: Flash AS3: why won't Inverted masks work? (BlendMode.ERASE)

Posted: Thu Mar 31, 2011 20:16
by Traxus
goto10 wrote:Cool clip BTW.


Set the BPM Counter paramater to BPM Sync at 4 beats (the default) and watch it adjust to the tempo ;)
goto10 wrote:Can you elaborate a bit on what we should be looking for? On OSX this clip shows me black and white fully opaque, and the red parts are transparent. Is that what it should look like?
Yeah, that's the intended display, on my machine everything in red shows up as black instead of acting as a transparent background...

On the same token, the following swf uses particles with a radial gradient that fades out into an alpha of 0 for the soft edges... I've had some trouble with soft edges having a solid background appended to them(see image). My feeling is that this will display correctly on a mac as well...

http://shyid.com/misc_upload/Orbgy.swf

Image

Re: Flash AS3: why won't Inverted masks work? (BlendMode.ERASE)

Posted: Fri Apr 01, 2011 11:04
by Joris
Good to know what we're supposed to see (or not see as the case may be). We'll give it a check on a PC then!

Re: Flash AS3: why won't Inverted masks work? (BlendMode.ERASE)

Posted: Mon Apr 04, 2011 22:22
by Traxus
One more tidbit that might help you guys out with this...

The alpha gradients for the particles in the Orbgy swf file display just fine *until* i add the Rectangler swf...

I don't even have to play the Rectangler swf to break Orbgy... So it would appear as if BlendMode.Erase is corrupting any kind of 'complex' alpha stuff in flash...

Re: Flash AS3: why won't Inverted masks work? (BlendMode.ERASE)

Posted: Wed Apr 06, 2011 14:11
by Joris
Hey Traxus

We've confirmed the issue on PC and made a ticket for it.

Joris