android & libgdx - disable blurry images rendering

Posted by android developer on Stack Overflow See other posts from Stack Overflow or by android developer
Published on 2012-03-23T23:26:12Z Indexed on 2012/03/23 23:29 UTC
Read the original article Hit count: 307

Filed under:
|
|
|
|

i'm trying out libgdx as an opengl wrapper , and i have some issues with its graphical rendering : for some reason , all images (textures) on android device look a little blurred using libgdx . this also includes text (font) .

however, for normal images , even though i show the entire image , i expect it to look as sharp as i see it on a computer , especially if i have such a good screen on the device (it's galaxy nexus) . i've tried to set the anti-aliasing off , by using the next code : final AndroidApplicationConfiguration androidApplicationConfiguration=new AndroidApplicationConfiguration(); androidApplicationConfiguration.numSamples=0; //tried the value of 1 too. ... i've also tried to set the scaling method to various methods , but with no luck. example: texture.setFilter(TextureFilter.Nearest,TextureFilter.Nearest);

as a test , i've found a sharp image that is exactly the same as the seen resolution on the device (720x1184 for galaxy nexus , because of the buttons bar) , and i've put it to be on the background of the libgdx app . of course , i had to add extra blank space in order for the texute to be loaded , so the final size of the image (which will include content and empty space) is still a power of 2 for both width and height (1024x2048 in my case) . on the desktop app , it look ok . on the device , it looked blurred.

a weird thing that i've noticed is that when i change the device's orientation (horizontal <=> vertical) , for the very short time before the rotating animation starts , i see both the image and the text very well .

can anyone please help me?

© Stack Overflow or respective owner

Related posts about android

Related posts about fonts