After learning the textures in andengine, we found that textureoptions has the following options in the source code:
public static final TextureOptions NEAREST = new TextureOptions(GLES20.GL_NEAREST, GLES20.GL_NEAREST, GLES20.GL_CLAMP_TO_EDGE, GLES20.GL_CLAMP_TO_EDGE, false);public static final TextureOptions BILINEAR = new TextureOptions(GLES20.GL_LINEAR, GLES20.GL_LINEAR, GLES20.GL_CLAMP_TO_EDGE, GLES20.GL_CLAMP_TO_EDGE, false);public static final TextureOptions REPEATING_NEAREST = new TextureOptions(GLES20.GL_NEAREST, GLES20.GL_NEAREST, GLES20.GL_REPEAT, GLES20.GL_REPEAT, false);public static final TextureOptions REPEATING_BILINEAR = new TextureOptions(GLES20.GL_LINEAR, GLES20.GL_LINEAR, GLES20.GL_REPEAT, GLES20.GL_REPEAT, false);public static final TextureOptions NEAREST_PREMULTIPLYALPHA = new TextureOptions(GLES20.GL_NEAREST, GLES20.GL_NEAREST, GLES20.GL_CLAMP_TO_EDGE, GLES20.GL_CLAMP_TO_EDGE, true);public static final TextureOptions BILINEAR_PREMULTIPLYALPHA = new TextureOptions(GLES20.GL_LINEAR, GLES20.GL_LINEAR, GLES20.GL_CLAMP_TO_EDGE, GLES20.GL_CLAMP_TO_EDGE, true);public static final TextureOptions REPEATING_NEAREST_PREMULTIPLYALPHA = new TextureOptions(GLES20.GL_NEAREST, GLES20.GL_NEAREST, GLES20.GL_REPEAT, GLES20.GL_REPEAT, true);public static final TextureOptions REPEATING_BILINEAR_PREMULTIPLYALPHA = new TextureOptions(GLES20.GL_LINEAR, GLES20.GL_LINEAR, GLES20.GL_REPEAT, GLES20.GL_REPEAT, true);public static final TextureOptions DEFAULT = NEAREST;
Some netizens in the Forum gave the following instructions:
-Nearest: faster then bilinear as only the nearest pixel on
Texture is used (sprites tend to look pixelated when, physical resolution is higher or lower than texture resolution. up/down-scaling)
-Bilinear: slower than nearest, but looks better, as not only one pixel from the texture is fetched but the 4 nearest.
The difference between those and the repeating textureoptions is the way OpenGL treats texturecoordinates that are out of the physical bounds of the texture (usually ranging from 0.0 to 1.0 ).
Where repeating paints the texture twice when the coordinates go from 0.0 to 2.0, NON-REPEATING will stretch the outermost pixel of the texture what looks pretty uugly.
So the repeating textureoptions are used only in very special cases.
For a description what the premultiplyalpha-Thing is, have a look here:
Click Open Link
In general, nearest is faster than bilinear, because nearest uses a pixel closest to the zoom position during scaling, while bilinear uses the nearest four pixels to determine the final display effect of the zoom position. However, bilinear achieves better results than earest.
Repeating is only used in special cases.