Clipping shadows over certain area's of a layer.

For questions about using Classic.

Post » Sun Dec 13, 2009 8:23 pm

The Problem

Ok you've got four layers in your layout, from top to bottom, in the following order.


A character layer, for the actual player/npc's etc.

A shadow layer, where sprites of fake shadows are placed.

A middle layer, lets call that "walkway".

A background layer which is supposed to be empty or far away, lets call that "stars".


As the character and NPC sprites moves around, the shadows under them follows correctly and all works great, except the shadows appear where they shouldn't, in this case they appear OVER the stars layer in the background, rather than being clipped at the edge of any artwork in the walkway layer like they should. Resulting in it just looking wrong.


The Question

How do you stop the shadow sprites from appearing over the stars layer? You can't use Canvas (and wouldn't work for this anyway), you can't erase the shadows around the edges of the walkway layer by using eraser sprites because the artwork has an intentional irregular edge as well as many small spaces within the artwork from alpha channels (think the spaces between branches of a tree) and therefore you'd be having to use thousands of perfectly shaped sprites to do so, which isn't a viable option (even though it works, it just isn't usable in this case).


I trust this is possible to fix though. The sprites in the shadow layer must not appear over or effect the stars layer in any way. However sprites in the characters layer may cross unaffected. This only applies to the shadows.
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Sun Dec 13, 2009 10:14 pm

There's the mask effect but I don't really get it yet, so I can't really explain.

On the other hand, you just gave me an idea for a weird effect :P

EDIT: nevermind, can't modify layer alpha :(
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sun Dec 13, 2009 10:28 pm

[quote="Madster":tel0yuws]There's the mask effect but I don't really get it yet, so I can't really explain.

On the other hand, you just gave me an idea for a weird effect :P[/quote:tel0yuws]

It's my idea, no stealing!!! haha, just kidding :D

I had a look at the mask effect too but didn't get nowhere with it either.

The projected "fake" shadow works perfectly (and looks great), and using eraser sprites/tiled backgrounds does work to limit where they appear, but only in very few, specific and unrealistic situations, so isn't a viable solution either. What would work would be some way to limit how many layers deep a layer can effect.
B
3
S
2
G
3
Posts: 628
Reputation: 2,531


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests