# Textures quality issues with Libgdx

I have drawn several vector objets and characters ( in Adobe Illustrator ) for my game on Android. They are all scalable at any size without any quality losses ( of course it's vector ^^ ).

I have tried to simulate my gameboard directly on Illustrator just before setting my assests on libdgx to implement them in my game.

I set all the objects at the good size, so that they fit perfectly on my XHDPI device I am running my test on.

As you can see it works great ( for me at least ^^ ), the PNG quality is good for me, as expected !

So I have edited all my PNG at this size, set my assets on libgdx and build my game apk.

And here is a screenshot of my gameboard ( don't pay attention at the differences of placing and objects, but check at the objets presents on both screenshot ).

As you can see, I have a loss of my PNG quality in the game. It can be seen clealry on the hedgehog PNG, but also ( but not as obvious ) on the mushroom ( check at the outline ) and the hole PNG. If you really pay attention, on every objects, you can see pixels that are not visible on my first screenshot.

And I just can't figure out why this is happening Oo If you have any ideas, you are very welcome !

Thanks.

PS : You can check more clearly the 2 gameboard on this two links ( look at them at 100%, display at high resolution ) :

Poor quality link, from the game

Second phase of tests :

We display an object ( the hedgehog ) on our main menu screen to see how it looks like. The things is that it looks like he is suppose to, which means, high quality with no pixels.

The hedgehog PNG is coming from an atlas :

layer.addActor(hedgehog);


No loss of quality with this method

So we think the problem is comming from the method we are using to display it on our gameboard :

blocks[9][3] = new Block(TextureUtils.hedgehog, new Vector2(9, 3));


the block is getting the size from the vector we are associating to it, but we have a loss of quality with this method.

• I guess you're talking about the aliased outlines? It looks to me that the good set has been drawn using alpha-blending and the bad set has been drawn using alpha-testing. I'm not familiar with libgdx. Can you set a blending mode? – GuyRT Jan 29 '14 at 16:41

2. Apply a TextureFilter on your textures. I would start with a Linear-Linear filter like this texture.setFilter(TextureFilter.Linear, TextureFilter.Linear). But I would also suggest you check out this article http://www.badlogicgames.com/wordpress/?p=1403 which explains in detail the aspects (especially performance ones) of applying different combinations of texture filters. Applying the right texture filter on your texture will make it look smooth on an upscale, making sure you don't get into performance troubles.