Lighting/shading Help

Get help using Construct 2

Post » Sun Jun 09, 2013 3:56 am

Hello all once again,

Im here because im trying to figure out about some shading and the best way for me to create realistic light.I am now working on the Day'Night Transition .I would love to find out how to create Lighting like Terraria it will be exactly what im looking for to make this project come even more to life.If you know anything about realistic 2d lighting feel free to fill me in. Thanks guys
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Sun Jun 09, 2013 6:40 am

Hey Rookie,

First step is opening up the lighting example built in with C2, once you understand the principle of that it should set you on your way.
ImageImage
B
96
S
19
G
6
Posts: 1,054
Reputation: 11,457

Post » Sun Jun 09, 2013 7:23 am

Hey @GenkiGenga,

Which one where you referring too? i seen a bunch of stuff on lighting but alot of the info was not helpful.I seen in old post from last year that some effects were supposed to be added or was added im not sure.Im at the point now where night time is an option.Thanks for the reply as always
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Sun Jun 09, 2013 7:41 am

Just the one that says 'Lighting', its a simple example with 2 light sources.

I have not actually played Terraria but from what I saw it seemed like there were just a bunch of little light sources.

The example works on a pure black background but if you set the opacity to 50 percent then you can start to see how it would work.

If you had a black box covering the screen, you could also simulate simple day/night by changing the opacity from 0 (day) to 60ish for night.

Keep in mind these are just simple suggestions though.
ImageImage
B
96
S
19
G
6
Posts: 1,054
Reputation: 11,457

Post » Sun Jun 09, 2013 9:00 am



@GenkiGenga Thank you for showing me that example,The one thing that it dosnt do is explain how and why it works.Im trying to do something like that but give the player the ability to use different colors. I placed a picture for reference.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Sun Jun 09, 2013 9:31 am

No worries,

Ok to break it down further, you see that there are 2 layers in the example. If you click in the layers tab and then on layer 1 you see in the left hand side that the background colour is set to black, whereas layer 0 is set to white.

Now click on the light source object, there are a bunch of different effects that you can add to objects, this one uses 'destination out' which creates that effect of looking like a flash light (because it is on the layer that has a black background).

If that light object was green instead of white then the light would look green too.

Most important thing to take from that example is that you need to do all your lighting as the top layer.GenkiGenga2013-06-09 09:32:07
ImageImage
B
96
S
19
G
6
Posts: 1,054
Reputation: 11,457

Post » Sun Jun 09, 2013 10:16 am

@GenkiGenga Thanks man,

The way you broke it down makes alot more sense and im starting to actually see how this can be used.I just dont see how i could implement this feature throughtout the whole world without having issues.Would it be possible to generate the light effect everywhere that isnt occupied by a block sprite tile?

I just dont see how to accomplish the ground staying dark but above ground being lit at daytime,Unless its somesort of constant,I do have a better understanding of this lighting engine and i notice how easy it is to manipulate.I just need to figure out a few more things and i will have it mastered in no time.Thanks @GenkiGengaRookieDev2013-06-09 10:30:51
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Sun Jun 09, 2013 7:58 pm

My pleasure, its great knowing how easy it is to get going :)

Hmm, I see what you mean with that screenshot. It looks like the darkness is made up of a grid of black boxes that dynamically shift their opacity based on the square next to them.

You could mimic that with a similar style but your right, it may not be efficient as its probably something they optimised the engine around. I could be wrong about that to be honest its not something I have played with too much.

On the other hand though, the underground shot above is easily achievable. With one tiled object set to 70 percent and a hand full of light sources. If you think within the box your creative problem then becomes how to transition from light to darkness when going underground.

You could have a triggered event that once you go below ground level your opacity could transition from light to darkness the deeper you went.

Just a quick thought anyway.
ImageImage
B
96
S
19
G
6
Posts: 1,054
Reputation: 11,457

Post » Sun Jun 09, 2013 11:43 pm

@GenkiGenga You just dont know how helpful you are!

I will be Prototyping the uses for this lighting effect,IMHO i think Construct 2 lighting effects look a thousand times better than what is in the picture.Like you said,It does look like a grid of black boxes and that is unappealling,Smooth lighting effects always win.Thank you again for schooling me on some awesome info.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Mon Jun 10, 2013 12:19 am

@RookieDev now ask @genkigenga about the shadows. Something like "where're the shadows of my solids?"
B
7
S
3
G
1
Posts: 154
Reputation: 1,812

Next

Return to How do I....?

Who is online

Users browsing this forum: AekiroStudio, Alex Bryant, ddabrahim, kiko2015, Momio, MSNbot Media and 10 guests