Lighting/shading Help

0 favourites
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • 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

  • 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.

  • 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

  • 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.

  • <img src="http://www.diygamer.com/wp-content/uploads/2011/11/disco-cavern.png" border="0" />

    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.

  • 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.

  • 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?<img src="http://pcmedia.ign.com/pc/image/article/117/1170612/terraria-20110525101905307_640w.jpg" border="0" />

    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 GenkiGenga

  • 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.

  • 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.

  • RookieDev now ask GenkiGenga about the shadows. Something like "where're the shadows of my solids?"

  • breackzin I seen a video on youtube regarding this but with me still being Kinda new im afraid i do not know how to make shadows appear like in this video. youtube.com/watch

    I am at the moment working on something epic with using the effects we mentioned above.I will post more details on this thread or maybe make a tutorial when im complete.But maybe GenkiGenga might know alot more about casting shadows than i do,Im sorry i couldnt give you more info,Did you check the Examples and Tuts?

    The above link just shows what it looks like and also showcases that it is possible to do.

  • RookieDev now ask GenkiGenga about the shadows. Something like "where're the shadows of my solids?"

    Im not sure how to take this, is this something you wanted to know yourself or a sarcastic remark? If its the former you don't need to ask it through someone else, lol.

    youtube.com/watch

    I just looked up the game and I don't see any shadow casting from objects. But Rookie is right, check your c2 folder examples and a capx for a similar effect is in there. Whether or not it would be feasible to use it for a massive level is the question.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • GenkiGenga I have one more question for you,

    If i wanted to create the light itself how would i go about doing that.Was the light sprite made in Construct or was it done in another program? I can easily create another light sprite in photoshop but i wanted to know if all of what is seen it that Tutorial was made in Construct with the animation editor?

  • Sorry for the late reply.

    No I don't think that light sprite was made in the c2. Its pretty limited in terms of what you can do with the editor graphically. Photoshop would be the go.

  • Its ok GenkiGenga i have been in your ear everytime you get on here.I hope im not getting annoying.I wanted to say after trying to recreate the spotlight sprite for myself on photoshop im quite lost.I cant seem to get it the right way.I really thought i would be able to create it.Do you have an idea on how it was made? there is more involved than meets the eye and at times like this i wish i would of stayed in art class.

    Edit...I actually figured it out man which is pretty awesome! i lost my touch with photoshop but i managed to figure it out.Thanks for everything thus far GenkiGenga if it wasnt for you i might be still looking to fix my parallax backround.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)