How do I Create An Alpha Mask With Shadows

Get help using Construct 2

Post » Wed Aug 13, 2014 10:44 pm

In short, I have have a Shadow Light on Layer 2, I have Sprites on Layer 1, and I have a pink background on Layer 0. What shader-fu do I need to do so, so that if a shadow was to overlap with any pixels on layer 1, it would turn their alpha/opacity to zero?

EDIT: Alternatively we can remove Layer 2 and just have the Shadow Light on Layer 1.
B
5
S
2
G
3
Posts: 36
Reputation: 1,622

Post » Thu Aug 14, 2014 4:19 am

If I understand correctly, using a shadow light might not be your best option for this. You instead might want to create a new sprite that looks like a shadow & check for that overlapping.
But I'm not sure I understand correctly.

Another option might be to check for sprites overlapping at an offset, instead of just checking whether they're overlapping.
Can you upload a .capx so we can see your setup?
Phase 1: Collect Underpants.
Phase 2: ????
Phase 3: Profit!
B
16
S
5
G
4
Posts: 106
Reputation: 2,450

Post » Thu Aug 14, 2014 5:27 am

I can, but it's fairly barren. What I'm basically trying to do is get the "fog of war" effect such as in Monaco (http://media.pcgamer.com/files/2013/04/ ... header.jpg). The reason why I see shadow light as the optimal solution is because it's already rendering on the pixels that I want to be rendered, except instead of changing them to (1,1,1,255) I want to make the pixels on the layer directly on or below the shadow light transparent (1,1,1,0).

If this isn't something possible to do in editor, could some-one point me in the direction of where I can find it in the SDK?
B
5
S
2
G
3
Posts: 36
Reputation: 1,622

Post » Fri Aug 15, 2014 6:50 am

Hello Kabuto,

What you are after is very possible. I suggest that you read the thread linked below for more information.
https://www.scirra.com/forum/how-do-i-make-shadows-and-light_t112497
B
43
S
24
G
20
Posts: 156
Reputation: 13,604


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests