Phaser3 - webgl lights (Light2D) - am I missing something, or are they broken?

Hi guys,

It seems to me, that the Light2D pipeline is broken in phaser3 v3.18.1-FB (installed via npm).

I run into the following probelms, that can also be recreated by editing lab examples:

if a sprite or image doesn’t have a normal map it completely disappears if you activate the pipe2d pipeline.
(easy reproduction: remove normal map loading form this example: http://labs.phaser.io/edit.html?src=src\game%20objects\lights\change%20max%20lights.js )

if a static tilemap layer is assigned the Light2D pipeline, the ambient color is working, but no lights are rendered.
(tested by setting the renderer to webgl on this example: http://labs.phaser.io/edit.html?src=src\game%20objects\tilemap\static\create%20from%20objects.js and adding:

this.lights.enable().setAmbientColor(0x333333);
var light = this.lights.addLight(10, 20, 200).setColor(0xffffff).setIntensity(2);
layer.setPipeline('Light2D');

Can somebody confirm this, or am I doing something wrong?

1 Like

yeah i can’t get the lights to work for me either

Yep, the light module is in the bug directory:
http://labs.phaser.io/index.html?dir=bugs/&q=

I have the same issue, did you find a solution?

Each texture in the Light2D pipeline needs a normal map, AFAIK.

Yes, really it requires adding a normal map like this
this.load.image('image_key', ['image_file', 'map_file'])
and as default map you could use 1px image with #7F7FFF color.

2 Likes

I wish this was fixed for Sprites :frowning:

1 Like