[Solved]How do I hide part of an additive sprite with a mask

Get help using Construct 2

Post » Mon May 26, 2014 12:46 am

Howdy fellow Constructeers !

I'm having some trouble with blend modes...

On my picture attached, the light sprite is in additive blend mode.

Is there a way to hide only the light sprite with the black rectangle using blend modes ? I just want the part of the light that is overlapping the black shape to disappear while the rest stays the same... I have tried many things but I mostly end up with either only a black shape, or nothing at all (light sprite still visible).

Thank you kindly for any clue ! :)
You do not have the required permissions to view the files attached to this post.
Last edited by Oruzee on Mon May 26, 2014 3:02 pm, edited 2 times in total.
Image Hats off to me too !
Steam user
B
12
S
2
G
1
Posts: 29
Reputation: 933

Post » Mon May 26, 2014 12:04 pm

Here's a .capx which will show the layers I have, the black shape on the layer LightMask corresponds to the zone the light is supposed to be invisible...
I'm trying to hide only the layer "Light" where the light sprite overlaps the black one.

Thank you by advance :)
You do not have the required permissions to view the files attached to this post.
Image Hats off to me too !
Steam user
B
12
S
2
G
1
Posts: 29
Reputation: 933

Post » Mon May 26, 2014 3:01 pm

Figured it out.

In case someone needs the trick, I just had to turn the black rectangle into a totally empty sprite then put it in destination atop mode, on a superior z-order than the light, same layer.

See the attached .capx
You do not have the required permissions to view the files attached to this post.
Image Hats off to me too !
Steam user
B
12
S
2
G
1
Posts: 29
Reputation: 933

Post » Mon May 26, 2014 3:51 pm

Nice :)
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Mon May 26, 2014 3:59 pm

@eli0s @Oruzee

Masking + Lighting system = ???

If anyone can make it work I'm sure you guys can!
B
62
S
23
G
10
Posts: 647
Reputation: 10,578

Post » Mon May 26, 2014 4:15 pm

I'm guessing it can save a lot of memory if you're only masking sprites instead of casting rays or calculating shadows in real time.

Just moving/resizing/changing angle of the mask already makes a pretty controllable shadow mask system without using too much CPU :)
Image Hats off to me too !
Steam user
B
12
S
2
G
1
Posts: 29
Reputation: 933

Post » Mon May 26, 2014 5:33 pm

@Mr E Bear I am having difficulties with blending modes. I am an After Effects user with no experience on Canvas2D or HTML5 so I don't really get all of these modes. I still try to wrap my mind around some of their basic functions. What I really wish for is a dedicated masking system that uses grayscale/opacity values (with the ability to invert the input values) for masking. And that should apply to any layer or sprite. I hope that it's technically feasible and that anytime soon Ashley will make it happen!
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Sun May 29, 2016 9:31 pm

Thank You!
B
12
S
3
Posts: 26
Reputation: 821


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 11 guests