Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tilemap Vertical Alpha Banding / Artifacting #3766

Closed
the-simian opened this issue Jun 18, 2018 · 4 comments
Closed

Tilemap Vertical Alpha Banding / Artifacting #3766

the-simian opened this issue Jun 18, 2018 · 4 comments

Comments

@the-simian
Copy link

the-simian commented Jun 18, 2018

I'm not 100% sure what the best way to describe this issue in words is, so I will use images.

image

You can see here that sometimes, the Tilemap produces a vertical banding effect. Here is a gif:
tilemap-banding

A few things: I am using Tiled, as the editor for the Tilemap and loading it that way.

Here is the part to the code:

this.map = this.make.tilemap({ key: 'map' });
    const tiles = this.map.addTilesetImage(
      'rock-tilemap',
      'tilemap-rock-grass'
    );
  this.mapLayerGrass = this.map.createStaticLayer('grass', tiles, 0, 0);
  this.mapLayerGround = this.map.createStaticLayer('ground', tiles, 0, 0);

Here is the full code : https://github.com/simiancraft/create-phaser-app/blob/master/src/scenes/game.js

here is the tilemap:
image

I used a 1px padding around the tiles

Here is the relevant level code: https://github.com/simiancraft/create-phaser-app/blob/master/src/assets/levels/test-level.json

You can see the effect in the gh-pages, this code is running.

If this is expected, or is a side effect of a certain way I am loading this, I apologize in advance. I can't quite determine if this is my usage or if its in the engine itself.

@flowan
Copy link

flowan commented Jun 18, 2018

I had the exact same issue and fixed it by setting the second parameter of the camerca startFollow function to true this.cameras.main.startFollow(this.player, true);

I hope this helpes.

@the-simian
Copy link
Author

@flowan ,let me try that! Thank you so much for responding!

@photonstorm
Copy link
Collaborator

The tiles need to be extruded if you want to use WebGL. This will help: http://phaser.io/news/2018/05/webgl-tile-extruder

@the-simian
Copy link
Author

@photonstorm ,thank you very much! I didn't know about this until now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants