Ianmh Posted August 13, 2017 Share Posted August 13, 2017 I have been messing around trying to get Anti-aliasing working for a few days now. I was using a very large image, over 2000px wide and had scaled it to about 200px. It was constantly aliased no matter what I tried. By chance I changed the scale and brought it up to .5 and immediately things started looking better. Is this normal? ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 13, 2017 Share Posted August 13, 2017 Welcome to the "I know what mipmapping is" club. Make it 2048 (power-of-two), pixi/webgl will automatically make mipmap for it: series of images that are .5 of each other. Read up what mipmapping is in the web, then look at 0. https://github.com/pixijs/pixi.js/blob/dev/src/core/textures/BaseTexture.js#L177 1. https://github.com/pixijs/pixi.js/blob/dev/src/core/renderers/webgl/TextureManager.js#L139 2. https://github.com/pixijs/pixi-gl-core/blob/master/src/GLTexture.js#L233 The main idea is that for specific pixel you have to determine which color is the texture. Sampling just one point from original picture is not enough, so instead its sampling point from one or two "levels" of picture that has to be pre-generated. Taz 1 Quote Link to comment Share on other sites More sharing options...
Ianmh Posted August 14, 2017 Author Share Posted August 14, 2017 Thanks for the info, really wish I had of asked sooner, graphics look so much better. How does this apply to texture packed images, I assume it would be the dimensions of each individual image and not the whole sheet? Quote Link to comment Share on other sites More sharing options...
themoonrat Posted August 14, 2017 Share Posted August 14, 2017 It applies to the base texture Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 14, 2017 Share Posted August 14, 2017 It applies to whole base texture, but you have to add some constrains on it: if two neighbour textures somehow make it to the same big pixel, the result wont be good. Make it that way every small region coordinate is multiple of 8, if you want to use zoom <=8.0, 16 if zoom<=16.0 and so on. It can also be done with padding. Search for those settings in the texture packer you use (i dont know which one). 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.