3D Lighting with basic material support

I was a bit away from Defold for the past months, now that i came back the first thing I did was check out my last projects, which was a 3D lighting extension, DEFifnitely-Lit. Thing is, the months i spent away i was perfecting my programming skills in my internship and in the college. With this, when i looked at what i have done in DEFifnitely-Lit, with all its bugs and spagetti code, i thought id need to fix it, as even i wasnt understanding what was happening. The code and bugs were so bad i felt the need to rewrite everything again. Then LightsOn was born. That gave me the opportunity to update the light system to support basic materials:
image
The code is now way more performant, much more readable and clean overall.

This is the first project that made me somewhat proud. I went a step further in lighting and in Defold programming in general, without needing to ask around too much. In resume, im evolving and im happy about it! The next task is to revisit the bloom effect i tried to recreate in defold using rendertargets.

How to use LightsOn:

Like DEFinetly-Lit, this extension is supposed to be really easy to use. Just apply the LO_smooth.material to your mesh and have said mesh inside a go, then attach to that go the LO_lightReciever.script. This script can be easily tweakable to give a lot of options about how your mesh should reflect/recieve light. Many great values can be found here. If you followed all steps, now your mesh can recieve light properly. To add a light source to your scene, add either a lamp or sun object, these should be pretty self explanatory. Both objects have scripts that have values for the user to tweak as they please. More explanation about what the values mean can be found in Ogre3D wiki. A regular LightsOn scene should look like this:
image

Again, if you have any troubles or any problems using this lighting system, please feel free to contact me. I will be happy to fix it and continue this project. Although i will not be submiting this project to the asset portal, as i dont want to send something that isnt trully worth it. Theres much more that i want to do for this project, like makes lights active or deactive by proximation of the mesh and much more. As of now, im going for a big project somewhere soon, if my college and internship allow me so. And for that, this lighting system is just fine.

9 Likes