What to do when textures are not powers of 2?

What to do when textures are not powers of 2?

When textures are not powers of 2, you (or the software you use) will usually have to use special extensions made by the hardware/driver manufacturers if you want them to work consistently. For instance, OES_texture_npot or ARB_texture_non_power_of_two.

What is the power of two in texture optimisation?

The following discusses one of these rules; that of texture size, their dimensions and how these relates to a form of texture optimisation, commonly referred to as the ” Power of Two ” rule.

Can you use power of two textures in OpenGL?

Since the release of OpenGL 2.0, developers have the option of using textures without specific dimensions. In the past, these texture sizes were required to be powers of two. However, there are advantages to using textures with power-of-two dimensions.

What are the problems with re-sizing textures?

Forced re-sizing of texture assets tends to cause two inherent problems; blurring combined with JPG compression artifacts. On the right a close-up shows increased pixelation issues due to the image being re-sized by the game engine resulting in additional artifacts and aberrations which distort the “3” (when compared to the original below)

Can a non power of two texture be used in wrap mode?

Modern hardware can (finally) cope with enabling wrap modes on non-power of two based textures, however non-power of two textures still tend to waste GPU memory as they tend to get padded up along the width by some hardware specific amount (either to some tile size or rounded up to the next power of two size that contains the texture).

How to deal with odd size of textures?

One way of dealing with odd size textures is using a Texture Atlas. Basically, you place multiple textures together into a single texture and use the texture coordinates of your vertices to reference the particular image you need. This comes with additional performance benefits as well, because it allows to avoid state changes.

Which is better pot textures or npot textures?

Finally, a few additional points should be considered when using NPOT textures: • POT textures should be favoured over NPOT textures for the majority of use cases as this gives the best opportunity for the hardware and driver to work optimally.