Lighting problem with backgrounds

Get help using Construct 2

Post » Thu Nov 29, 2012 1:00 pm

Hi, this has been troubling me for a while now..

Say you've set up your layers for lighting, similar to the example file 'lighting', or by using the lighten/multiply shaders as shown in this .capx (link)

Lighting layer   (All black, but with light objects that act like 'erasing' the darkness)
Main layer   (visible game stuff, like the player etc)
Backdrop layer   

This works great for the main layer, but anything displayed on the backdrop (which could be something really far away, for example mountains or space) will be affected by the lighting in the same way.

This makes no sense from a design standpoint..
for example, a torch held by the player should not light up the stars in the night sky behind him (they should already be lit)
and if the player is inside a dark house but on a sunny day, the view out of a window should still be bright.

so any ideas on a work around?

tldr: how do i make the background image in the following cap be unaffected by the top layer:
(link to .capx again)keepee2012-11-29 13:05:20
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Sat Dec 01, 2012 2:41 pm

shameful bump

also i've just noticed I accidentally put the gray sprite on the background layer, (it's meant to be on main), I updated the file.
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Mon Dec 03, 2012 8:20 am

One last bump then I'll let this die.

I feel like the only way to do this is if there was a way to group layers and set the 'force own texture' setting for the group.

That way I could have main and lighting layers rendered seperately from the background layer. With lighting set to 'source atop'.. thus keeping the transparency where there is no objects.

I get the impression this is how other games would get the effect, but i'm no programmer so i'm not sure.
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Mon Dec 03, 2012 12:16 pm

I'm actually interested in this as well. Can't look at the capx's at the moment but the issue you mention makes sense.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400


Return to How do I....?

Who is online

Users browsing this forum: Lof and 4 guests