phaser icon indicating copy to clipboard operation
phaser copied to clipboard

using setPipeline('Light2D') on my sprites / tilemaps make them disappear

Open ilackarms opened this issue 2 years ago • 1 comments

Version

  • Phaser Version: 3.55.2
  • Operating system: macOS
  • Browser: Tried with Chrome & Brave

Description

When using setPipeline('Light2D') on any of my game objects or tilemap layers, they simply stop getting rendered. My game is set to WEBGL rendering mode.

Example Test Code

using config:


 const config: Phaser.Types.Core.GameConfig = {
    type: Phaser.WEBGL, 
    ...

loading my tileset:

    this.load.image({
          key: 'wasteland_tiles',
          url: 'assets/img/tiles/wasteland_tiles.png',
          normalMap: 'assets/img/tiles/wasteland_tiles_n.png'
    })

simply setting the following:

    map.layers.forEach(layer => {
      layer.tilemapLayer.setPipeline('Light2D') // enable lights
    })

causes my map not to be rendered

Additional Information

In this image you can see that some scene elements are rendered but most are not. it's not clear to me why the trees/rocks are being rendered while the rest of the tilemap layers are not (even though i set Light2D on all map layers).

image

ilackarms avatar Jan 12 '22 12:01 ilackarms

just a note that i am also using grid-engine plugin in my game, not sure if this would have an effect but perhaps?

ilackarms avatar Jan 12 '22 12:01 ilackarms

The current test (https://labs.phaser.io/view.html?src=src/game%20objects/lights/tilemap%20layer.js&v=dev) is working fine on macOS on Chrome and Safari (on an iMac M1), so it's possible this might be device specific, or just something else. Try out the labs test and see if that renders ok, if it does, the issue is outside of the API at least. If it doesn't, we'll need more hardware details I think.

photonstorm avatar Nov 17 '22 17:11 photonstorm