phaserjs / phaser

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
https://phaser.io
MIT License
37k stars 7.09k forks source link

Black lines rendering on certain camera and tileset settings #6907

Open MarcJamesIO opened 5 days ago

MarcJamesIO commented 5 days ago

Version

Description

Black lines rendering over the screen when camera moves or at certain zooms, making it unusable.

Example Test Code

Live bug example: https://phaser-test-hazel.vercel.app/

Code: https://github.com/MarcJamesIO/phaser-test

Additional Information

tile extruder tool: https://github.com/sporadic-labs/tile-extruder

Tile extruder tool has been mentioned as a potential fix: The original tileset has no margin or spacing which should render properly. Of course the black lines appear. So following advice we try the tile extruder tool:

tile-extruder --tileWidth 128 --tileHeight 128 --input ./assets/grassland.png --output ./assets/new-extruded.png

Because the tiles are 128 x 128 and there's no margin or spacing. We then follow the tile extruder docs and load as shown:

const grasslandTileset = this.map.addTilesetImage( "grassland", "grassland", 128, 128, 2, 1 );

Makes no difference, lines still appear.

photonstorm commented 5 days ago

Additional information from testing:

Happens in Canvas, too. Happens even right back to v3.55.2 - not a new bug Happens with pixelArt on/off and RP on/off. Those don't cause it. Happens with fixed size canvas with no scale mode.

Not yet tested with one of our own tilemaps. The problem isn't extrusion though.

samme commented 5 days ago

I've been testing the extruded dungeon tileset with camera zoom 0.714 and seen:

https://phaser.io/sandbox/vp8vBLuJ

MarcJamesIO commented 5 days ago

It happens both in Phaser v3.85.0 or v3.80.1 just to a much lesser extent in v3.80.1

photonstorm commented 5 days ago

Samme meant the sandbox link above, using the fully extruded dungeon tileset, doesn't have the black lines under 3.80.1 - and it doesn't. That test also doesn't have camera zooming in it, though, so isn't an apples to apples comparison.

azarzaza commented 1 day ago

I faced the same issue on the current version of phaser v3.85.0, but after reverting back to v3.80.1, it works.