Britzl Lights and Shadows library crashes engine

I am attempting to create a game background that uses the lights with a random color moving around randomly - similarly to a screensaver.

The lights are created by a factory into a separate “background” collection, which has the light_quad object.

I noticed that i can only add a certain number of lights before the engine crashes. In testing, I found that having <10 is stable, but anywhere between having 10-20 lights might crash, and having more than 20 was impossible. Manually copying the light game object instead of creating them at runtime does not fix the problem.

I am using a custom render script so I can also use Rive

The lights move around to create an interesting background. There are no shadows or sprites with the “occuler” material.

Defold version 1.4.7

I am using Linux mint/ubuntu

Github repo with a demo project that shows the problem

indented result:

Thanks for the repro case!
Yes, indeed it seems like a use-after-free crash on the constant buffer.
We’ll look into it!

1 Like