What are the side effects of Libgdx numSamples?

I am trying to display a 512x512 image in a 50x50 square area in my viewport and I am using linear texture filtering. The size of the virtual viewport is 550x800 pixels. Thus, the square area in which the texture is drawn is scaled in accordance with the screen resolution.

texture.setFilter(TextureFilter.Linear, TextureFilter.Linear); 

On the Samsung Galaxy S3, whose screen resolution is 720x1280, the texture is smooth and satisfactory.

But on the Samsung Galaxy S2, whose screen resolution is 480x800, there are still problems with the alias. I did a search on the web and found the numSamples parameter AndroidApplicationConfiguration

 AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration(); cfg.numSamples = 5; 

The libgdx documentation says "2 is a good value," but I can't have a smooth rendering up to numSamples 5

My question is: what side effects can cfg.numSamples = 5 cause in terms of performance, battery usage, CPU overheating, etc.?

+4
source share
1 answer

numSamples is the amount of smoothing smoothing. See http://en.wikipedia.org/wiki/Multisample_anti-aliasing for more details.

You can look at mipmapping (TextureFilter.MipMap {Nearest / Linear} {Nearest / Linear}) texture filters. TextureFilter.MipMapLinearNearest or TextureFilter.MipMapLinearLinear will probably give you more attractive textures, but you need to make sure you set the useMipMaps flag in the Texture constructor to β€œtrue” to generate mipmaps.

0
source

Source: https://habr.com/ru/post/1501636/


All Articles