How to use Light files?

Hi everyone.

I have been checking Defold and I’ve run into Light File. I’m presuming this is something related to creating a light source for a material, but the documentation doesn’t seem to say anything about what it is or how to use it. Do I need to pass it to another file or add it to a collection?

Thanks.

I actually don’t know how these work. @sicher, can you enlighten us?

2 Likes

Hahahaha! I’ll have to do some experimentation. This is really old stuff… :slight_smile:

2 Likes

I am pretty sure @Ragnar_Svensson at some point said they don’t work at all…

1 Like

You might be right. If that is the case they should be removed. Filed an issue.

DEF-1547

I don’t recommend anyone using that component! We should remove it from the new-menus etc. It is something we made very early on, and it never reached maturity and should have been removed long ago. The reason we never completed it was how rarely dynamic lights are used in 2d-games, and if they were used, how easy it is to pass light-data without any component at all. Do something like this:

  • Custom render-script
  • Store light data somewhere (e.g. in a script)
  • Post it to the render-script through msg.post("@render:", … ) which can pass them to shaders through constant buffers
  • Or as shader constants to sprites, or whatever

At some point we need a proper lighting system, given how much easier it would be for artists but I would guess that won’t be prioritised in a while.

2 Likes