Panda3D Manual: Choosing a Texture Size
  <<prev top next>>     

Most graphics hardware requires that your texture images always be a size that is a power of two in each dimension. That means you can use any of the following choices for a texture size: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, or so on (but unless you have a really high-end card, you'll probably need to stop there).

The textures don't usually have to be square: they don't have to have the same size in both dimensions. But each dimension does usually have to be a power of two. So 64 × 128 is all right, for instance, or 512 × 32, or 256 × 256. But you can't make a texture image that is 200 × 200 pixels, since 200 isn't a power of two.

By default, Panda3D will automatically rescale any texture image down to the nearest smaller power of two when you read it from disk, so you usually don't have to think about this--but your application will load faster if you scale your textures properly in the first place.

Some newer graphics cards can render textures that are not a power of two. If you have one of these cards and you don't want Panda3D to scale your textures, you can disable this automatic scaling by putting the following line in your Config.prc:

textures-power-2 none

Note that some cards appear to be able to render non-power-of-two textures, but the driver is really just scaling the textures at load time. With cards like these, you're better off letting Panda do the scaling, or dynamic textures may render very slowly.

Other choices for textures-power-2 are down (to scale down to the nearest smaller power of two, the default) or up (to scale up to the next larger power of two).

Finally, 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 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.

  <<prev top next>>