Mesh.light.dispose(); WebGL warning: drawElements:

I have a mesh which behaves as a lamp.To Switch on the light I use the following commands

    lamp = new BABYLON.PointLight("Omni", new BABYLON.Vector3(0, 0, 0), scene);
lamp.range = 200;
lamp.intensity = 2;
lamp.parent = currentMesh;
currentMesh.light = lamp;

When I “switch off” the light using the command

I get the folling error:

WebGL warning: drawElements: Buffer for uniform block is smaller than UNIFORM_BLOCK_DATA_SIZE

Any ways to avoid this error message? is it a bug? Anyhow the light is disposed and this is just a warning.

Hi, @Jacob

could you please create Playground for your issue so its easer to reason about ?

Thank you

Also you don’t need to dispose light to switch it off
you can use light.setEnabled(true/false) to switch on and off

setEnabled(off )works fine without error messages.Thanks.

1 Like