Choosing a Texture Size

Texture Sizes

Acron keeps a texture at the size it was loaded or created at: every OpenGL version it supports (4.x on the desktop, ES 3 on the web and phones) samples, mipmaps and repeats textures of any size, and render targets are exactly the size asked for. The default is:

textures-power-2 none

Power-of-two sizes (1, 2, 4 … 1024, 2048) are still a good habit for art: their mipmaps halve evenly, and block-compressed formats want multiples of four. The software renderer (tinydisplay) and the Wii, whose rasterizers address texels by bit masks, scale a texture of another size down to the nearest power of two themselves when they upload it; nothing in the game changes.

A game can still have textures rescaled at load: textures-power-2 down scales each one down to the nearest smaller power of two, up to the next larger one, and pad frames it in a larger power-of-two texture with black borders (then render targets are padded too, and it is up to your code to apply texture.getTexScale() where needed; a padded texture cannot repeat).

Note that the size you choose for the texture image has nothing to do with the size or shape of the texture image onscreen–that’s controlled by the size and shape of the polygon you apply it to. Making a texture image larger won’t make it appear larger onscreen, but it will tend to make it crisper and more detailed. Similarly, making a texture smaller will tend to make it fuzzier.