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

FFGL, OSC, GLSL. If you like abbreviations, this is the forum for you
Post Reply
User avatar
Traxus
Met Resolume in a bar the other day
Posts: 12
Joined: Thu Feb 03, 2011 06:22

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

Post 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...

Joris
Doesn't Know Jack about VJ'ing or Software Development and Mostly Just Gets Coffee for Everyone
Posts: 5185
Joined: Fri May 22, 2009 11:38

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

Post 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 16898 times
Joris

User avatar
Traxus
Met Resolume in a bar the other day
Posts: 12
Joined: Thu Feb 03, 2011 06:22

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

Post by Traxus »

Weird... is it my video card? I've got a pretty beefy one, gig of ram, ATI moblity Radeon 5870...


Image

edwin
Team Resolume
Posts: 1202
Joined: Thu Oct 07, 2004 10:40

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

Post 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.

User avatar
Traxus
Met Resolume in a bar the other day
Posts: 12
Joined: Thu Feb 03, 2011 06:22

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

Post 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

Joris
Doesn't Know Jack about VJ'ing or Software Development and Mostly Just Gets Coffee for Everyone
Posts: 5185
Joined: Fri May 22, 2009 11:38

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

Post 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.

User avatar
Traxus
Met Resolume in a bar the other day
Posts: 12
Joined: Thu Feb 03, 2011 06:22

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

Post 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

Joris
Doesn't Know Jack about VJ'ing or Software Development and Mostly Just Gets Coffee for Everyone
Posts: 5185
Joined: Fri May 22, 2009 11:38

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

Post 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!

User avatar
Traxus
Met Resolume in a bar the other day
Posts: 12
Joined: Thu Feb 03, 2011 06:22

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

Post 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...

Joris
Doesn't Know Jack about VJ'ing or Software Development and Mostly Just Gets Coffee for Everyone
Posts: 5185
Joined: Fri May 22, 2009 11:38

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

Post by Joris »

Hey Traxus

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

Joris

Post Reply