Easy Posted May 24, 2016 Share Posted May 24, 2016 I use texture atlas for tiled map. I use firefox. Today i run my game in Google Chrome and saw border between tiles. Each tile on the left is from one pixel to the previous. Just like positiion.x - 1px. I don't know what i can do. Help me please. var loader = PIXI.loader; loader.add(Resouce.name); loader.load(function() { var texture = PIXI.loader.resources[Resouce.name].textures["grass.jpg"]; texture.baseTexture.scaleMode = PIXI.SCALE_MODES.NEAREST; var sprite = new PIXI.Sprite(texture); }); atlas.json Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 24, 2016 Share Posted May 24, 2016 Hello! Please pack your texture with TexturePacker (paid) or Shoebox (free), and specify "reduce border artifacts", also set some border=1 or better 2. https://github.com/pixijs/pixi-tilemap also takes care of the issue. Quote Link to comment Share on other sites More sharing options...
Easy Posted May 24, 2016 Author Share Posted May 24, 2016 12 minutes ago, ivan.popelyshev said: Hello! Please pack your texture with TexturePacker (paid) or Shoebox (free), and specify "reduce border artifacts", also set some border=1 or better 2. https://github.com/pixijs/pixi-tilemap also takes care of the issue. I use spritesheet-js because i don't use windows. Maybe there's another fix? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 24, 2016 Share Posted May 24, 2016 I thought Shoebox doesnt need windows. There are three ways 1. use https://github.com/pixijs/pixi-picture (example code http://pixijs.github.io/examples/index.html?s=picture&f=border-artifacts.js&title=Border%20artifacts&plugins=pixi-picture&v= ) 2. use pixi-tilemap but to reduce artifacts your tiles must be SQUARES 3. pack textures with a border and reduced border artifacts option. The first way is naive and slow, while the second and third way are effective. Quote Link to comment Share on other sites More sharing options...
Easy Posted May 24, 2016 Author Share Posted May 24, 2016 I fixed it with spritesheet-js! I just used flag --algorithm vertical. It's like hack, but it's working. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 24, 2016 Share Posted May 24, 2016 1 minute ago, Easy said: I fixed it with spritesheet-js! I just used flag --algorithm vertical. It's like hack, but it's working. Use --padding padding between images in spritesheet 1 if your scale is below 2, 2 if its below 4, 4 for 8 and so on. Because of mipmapping. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 24, 2016 Share Posted May 24, 2016 Solved. Scene was centered with half-integer coordinates. Even antialiasing didnt help that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.