Kokos Posted October 23, 2015 Share Posted October 23, 2015 I'm having a problem with scaled down sprites, they don't seem to be smoothed properly. In the screenshot below you can see the sprite on the left, its actual size is about 4 times as big. The original sprite is used on the model (this is a dress-up game), and the scaled-down sprite is used for the thumbnail. I re-use sprites as much as possible to prevent inflated file-sizes. It's not a resolution issue, as you can see from the sprites to the right, they are smoothed very nicely. The further I scale a sprite down, the worse it gets. The sprites are built on BitmapData, I've also tried running a resize on the sprite.key (BitmapData) instead of changing the sprite.scale, but that just removes the sprite all together (and to be honest I'd rather not do any more bitmapdata manipulations, as I have a lot of those in this game). Is there a reason why this is happening, and does somebody have a good idea on how to fix this? My PIXI scaleMode is set to the default Linear, and all Phaser settings for smoothing are on their default on states (I've tried explicitly turning everything on, which had no impact). Link to comment Share on other sites More sharing options...
chg Posted October 23, 2015 Share Posted October 23, 2015 You probably want to set the mipmap property of the texture to true and the texture sizes will need to be powers of two or Pixi will skip generating the mipmap anyway ( See: https://github.com/pixijs/pixi.js/blob/5d385885324e97369fd29b686e9e90eb4cefd14a/src/core/renderers/webgl/WebGLRenderer.js#L396 ) Link to comment Share on other sites More sharing options...
Kokos Posted October 23, 2015 Author Share Posted October 23, 2015 It seems to be working! Not for everything, and I have some other scaling issues that come up because of it. But at least some of it is now anti aliased (after forcing their dimensions to be powers of two). Doesn't work for canvas though EDIT: Also getting this to actually work with normal dimensions turns out to be really hard. Powers of two don't really align with the sizes I have to give the sprites. Link to comment Share on other sites More sharing options...
flow Posted March 9, 2018 Share Posted March 9, 2018 Has there ever been a proper solution for this issue? It seems that PIXI is upscaling sprites properly but downscaling cannot be improved by playing around with the (PIXI) scale mode. There is a rather old issue about it at PIXI as well (and a newer one from this year): https://github.com/pixijs/pixi.js/issues/1802 I wonder if this is different in Phaser3 ... Link to comment Share on other sites More sharing options...
Recommended Posts