Enlighten your games with a dynamic lighting !

7

Index

Stats

23,297 visits, 64,573 views

Tools

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 23 Dec, 2016. Last updated 19 Feb, 2019

Before you start, please note that english is not my mother tongue. Thus, there are certainly some mistakes and nonsenses in this tutorial. I did my best, but still. If anyone notices such mistakes, please signal it to me as soon as you can. I want to make you learn some stuff, not to burn your eyes. That's being said, let's get started.

Samples and demo CAPX are available on the last page. Have a good reading.

Lighting and Construct 2 : a love story

As awesome as Construct 2 can be, it currently doesn't have any real way to deal with dynamic lighting. Is it a real problem and should we blame Scirra for it ?

Certainly not. Dynamic lighting is originally something made for 3D games only, and as you know, Construct 2 is a 2D game engine. Plus, Scirra has already provided some features to play with light sources and shadows thanks to the Shadow caster behavior. If you’re interested in this feature, you can already find some tutorials about it and various examples of use are available in C2.

 

In this tutorial, we will not consider that kind of lighting, but this one :

This is a basic example of the results you can get with dynamic lighting on C2.

As you can see, it could be really awesome and useful for your game’s atmosphere. In this tutorial, we’re going to see how to use that in Construct 2 despite the absence of a native feature, we will explore the different alternatives, plugins and tools available, their pros, their cons, how they work in general and how to implement everything easily. Are you ready ? Here we go.

  • 8 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • LeuNoeleeste I ask because with a tutorial like this it is difficult to follow along without video. Also, I think it said somewhere in this tutorial that there is a limitation on lights? So using Matriarxs extension you can only have 3 lights in a scene?

    • Hello Borixsticks, sorry for replying this late, I hope you managed to keep going since then. Now to properly answer you, this tutorial is getting old, I plan to rewrite it with waaaay less fluff. There is no need to read the whole thing, just focus on Matriax's effect and you're good to go as far as Construct 2 goes, it remains the best option so far, even to these days, as it seems.

      However, it does have a limit : It can only handle 3 light sources. I had plan to write my own version of this extension, allowing the user to add more sources. It's still somewhere in the back of my mind, but I never got the required time to do it. In the meantime, you'll have to work around the 3-sources limit to add this kind of lightning in your current project or study the extension itself to make it versatile.

      Finally, I don't think a video would be useful. I'll simply rewrite the damn thing this summer so it takes less than 3 pages. It's a painful read in its current state.

  • Link is dead!

  • Awesome tutorial.

    I love it, ill may use it for my future games made in C2

  • Another nice normal map generation tool: boundingboxsoftware.com/materialize This was a great tutorial (which I read a while back.) I have used the Matriax effect and I also ported a procedural normalmap effect to C3 (specular and normalmap generated automatically.)

  • Absolutely a gem is that what I find here! Thanks for your effort in explaining the effect in detail and what I did not knew: There are three lights! At least something to start with! Almost fell of my stool. ;-p

    By the way may I humbly add two more ways to create bumps. ImBatch allows to create normal maps from multiple files at once - producing so la la quality. But it runs fast and is something like my Swiss Army Knife with all the file manipulation functions. Then there is ssBumpGenerator which you can get for free at Sourceforge. Like imBatch ssBump Generator is able to process more than one file and produces nice results.

    Hope that helps. Cheers!

  • Load more comments (2 replies)