Page 1 of 1

set full layer mask

PostPosted: Sat Mar 14, 2009 3:24 am
by lucid
mask and erase seem to be the same things but inverse of eachother. it would be helpful if I could mask the whole layer, and then use a small sprite to cut a whole and see a little circle cutout of the layer. or the reverse for erase

as of now if you want to do this you need to make a mask that takes up the whole view, with your actual mask shape in the middle. and if you want to be able to move it, the mask has to take up more than the view.

there should be a checkbox on the layer or on the mask effect, that allows you to start with the whole thing masked and then your mask sprite could cut a whole in that.

an example of the problem I'm trying to solve is in the cap below.
the idea is to only see the circle of pink stuff revealed, but if you move the mouse around you can easily ruin the effect.

problem.cap

on a side note, it'd be cool if you could toggle the behavior of overlapping masks to go more transparent or less so. as of now if I put two masks over eachother, it goes by whichever is more transparent. it'd be convenient to be able to trigger the opposite behavior, or an average. it's also not possible to combine erase and mask to fix either problem.

Re: set full layer mask

PostPosted: Mon Mar 16, 2009 10:51 pm
by lucid
so if no one responds and it's not in the todo list, does that mean it's not gonna happen?

Re: set full layer mask

PostPosted: Tue Mar 17, 2009 12:05 pm
by David
I think the best thing for us to do is add someting like

//#FULL-SCREEN

to the effect file, and then the runtime can mark that shader as one that clips to the entire screen rather than the object...then we would have the desired effect. It would make sense as well, since transparent areas become erased. The only problem is if the object leaves the screen entirely, it is considered invisible, so the rendering of that object wouldn't happen and you'd lose the effect :/

One work around is to use a canvas as an inbetween step. Make a canvas 640x480, then always paste the circular sprite into it, but make the sprite invisible, and the canvas have the 'erase' effect. Or swap layers around so you can use erase instead...

Re: set full layer mask

PostPosted: Tue Mar 17, 2009 8:09 pm
by lucid
thanks davi.
I've never really understood the canvas object, can you post a cap, preferably just an altered version of the one I posted here? if it's not too time consuming or too much trouble. It'd be a big help.
thanks either way

Re: set full layer mask

PostPosted: Tue Mar 17, 2009 8:42 pm
by lucid
ooh!!!!! Nevermind
figured it out!
works perfect!
Thanks, and as a bonus, the canvas makes perfect sense now!!!!
thanks again dave