How do I use shadowcaster with more than one light source?

Get help using Construct 2

Post » Mon Nov 09, 2015 2:02 pm

Hi!

As a test, I've tried using the RTS template, adding a light on the container of each tank and pinning it as you do for a turret, and adding the "shadowcaster" behaviour to the "solid" object.

When you move the entire group of tanks, it works (either when you provide a shadow height or when you provide a light radius). But when one of the tanks separates from the group, you realize shadows are getting casted from the main group (i.e. no light is coming from the isolated tank).

Hoy can I manage to have different tanks, each one casting light to its path?

I haven't saved the project, as it is easy to replicate.
B
44
S
15
G
6
Posts: 132
Reputation: 9,205

Post » Mon Nov 09, 2015 5:13 pm

slight edit to the capx (is this ok to post this, mods ?) all I have done is change the walls to their own layer and between these walls and the new background I added a semi opaque shadow layer.
(also added shadow catcher/lights as per your post :) )

https://goo.gl/mnkzNV
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Mon Nov 09, 2015 9:14 pm

I think I understand what Aracalaus meant, because I had the same problem, and it isn't solved in your capx file :
-> tanks aren't realistic lightsources, because if you have a tank on each side of a wall, a shadow is cast on each side, but instead they both should be enlighted

Unfortunately, as far as I know the "shadow caster" behaviour allows you to cast shadow (thx captain obvious) but that's all, so if an object is enlightened on multiple side, it will cast multiple shadows, and oposed lightsources won't cancel each-other's shadow...

I wanted to use it in my game too, but I have no idea how to fix the problem, and I'm not sure it's even possible in construct 2...
Hello !



I'm Steven, a 24 years old French graphic designer and programmer, and it's been 4 years since I started using Construct 2.
B
15
S
6
G
3
Posts: 70
Reputation: 2,573

Post » Tue Nov 10, 2015 8:56 am

Yes I see what you mean, sorry. I think you could do something along these lines using LOS to a tilemap but it would be a blocky?

also look at the following post where @Magistross posted a clever shadow casting capx which might give you a head start ? (only for one light, but with work ...)

viewtopic.php?f=147&t=150994&p=958035&hilit=+404#p958035

Please post if you make any progress ?
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Tue Nov 10, 2015 9:35 am

I believe it can be done with semi-transparent-shadows and the alpha-threshold effect on the layer where the shadows are..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Nov 10, 2015 11:27 am

RamPackWobble » Tue Nov 10, 2015 8:56 am
Yes I see what you mean, sorry. I think you could do something along these lines using LOS to a tilemap but it would be a blocky?

also look at the following post where @Magistross posted a clever shadow casting capx which might give you a head start ? (only for one light, but with work ...)

viewtopic.php?f=147&t=150994&p=958035&hilit=+404#p958035

Please post if you make any progress ?


Interesting idea, but the result is really blocky :?

Post by LittleStain » Tue Nov 10, 2015 9:35 am
I believe it can be done with semi-transparent-shadows and the alpha-threshold effect on the layer where the shadows are..


I didn't know this effect, bit I'll give it a try, thx for sharing !
Hello !



I'm Steven, a 24 years old French graphic designer and programmer, and it's been 4 years since I started using Construct 2.
B
15
S
6
G
3
Posts: 70
Reputation: 2,573

Post » Tue Nov 10, 2015 1:13 pm

@LittleStain

I tried this effect (AlphaClamp) but I'm not really sure I understood how to use it properly

Could you please help me out ? show me a CAPX example ?
Hello !



I'm Steven, a 24 years old French graphic designer and programmer, and it's been 4 years since I started using Construct 2.
B
15
S
6
G
3
Posts: 70
Reputation: 2,573

Post » Tue Nov 10, 2015 2:56 pm

I was talking about the effect Alpha-threshhold, downloadable from the effects-part of this forum, but trying to create a capx to show the effect I've hit some bumps..
I'm sure it can be done, some way, but I don't have the time trying to figure it out as I'm working on my own project...
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Nov 10, 2015 3:37 pm

Actually think I got it working, sort of..

It uses a combination of alpha clamp and alpha threshold (download from forum)..
Only places where none of the lights shine have shadows..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Nov 10, 2015 4:10 pm

@LittleStain That's a pretty clever way to deal with multiple lightsources not getting shadowcast over each others.
B
75
S
31
G
27
Posts: 1,000
Reputation: 20,735

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 31 guests