11
$\begingroup$

It's often said that texture dimensions should be square powers of two (512x512, 1024x1024, 2048x2048...), but what is the purpose of this really? I've given this advice myself and do it whenever I can, but never completely understood why.

I'd like to know how it affects Blender specifically (cycles/BI/GE). Does it save a little bit of memory? Or avoid a few calculations for render time? Or is it just a legacy game-engine thing left over from the days of on-board graphics, an old habit that won't die?

If possible, please provide some test results to back up the theory.

$\endgroup$
7
  • 3
    $\begingroup$ gamedev.stackexchange.com/questions/26187/… $\endgroup$
    – Justin
    Jul 20, 2014 at 12:40
  • $\begingroup$ Is this question close to becoming 'not about blender'? $\endgroup$ Jul 20, 2014 at 16:36
  • 2
    $\begingroup$ It reduces the over head for cpu/ram. Computer works in binary system, which works well with power of 2. Hence, requirements. You can easily check that out by adding textures of varying size in blender, and rendering it. $\endgroup$
    – Ali Jibran
    Jul 20, 2014 at 17:17
  • $\begingroup$ I believe some older video cards only worked when textures where power of 2, though as I understand it this has not been the case for several years. $\endgroup$
    – sambler
    Jul 21, 2014 at 4:59
  • 1
    $\begingroup$ This site might be the Perfect place to ask: area51.stackexchange.com/proposals/61961/computer-graphics $\endgroup$ Jul 23, 2014 at 15:05

1 Answer 1

7
$\begingroup$

It's probably better to ask a question like this on a dedicated programmers Q&A site since people there are more likely to focus on these things. Anyways, here are a few considerations that I am aware of.

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.

Using special GPU extensions to increase a programs abilities can also reduce compatibility since not every manufacturer is guaranteed to support them all and older machines from the same manufacturer may not support them either. This means that the software may run fine on your machine but not on the computers of other people.

Here is an excerpt from the PowerVR Performance Recommendations guide. This is the sort of thing that you will see in various documents from other GPU manufactures as well but the specific details will change slightly between them(ATI, nVdia, PowerVR, Mali, etc..) and even between different generations of cards made by the same company.

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. • A 512x128 texture will qualify as a POT texture, not an NPOT texture; rectangular POT textures are fully supported. • 2D applications (such as a browser or other application rendering UI elements where an NPOT texture is displayed with a one-to-one texel to pixel mapping) should see little performance loss from the use of NPOT textures other than possibly at upload time. • To ensure that texture upload can be optimally performed by the hardware, use textures where both dimensions are multiples of 32 pixels. • The use of NPOT textures may cause a drop in performance during 3D rendering. This can vary depending upon MIP-map levels, size of the texture, the texture’s usage and the target platform.

Basically, if you stick with powers of 2 then you are guaranteed multi-platform support and good performance, otherwise you may have problems when you try and work with a different machine other than the one you started on.

//------------------------------------------------------

I suppose as a metaphor, we could look at this as if textures and model data are like shipping containers used to transport goods on boats, trains and highways. If all the containers are the same, then everyone involved knows what to expect, and what to do when they encounter a container that must be shipped.

All the cranes will be able to grab it, and the container will fit into the same slot as all the rest.

If the container is different then the rest of them then there will likely be problems since none of the equipment was designed to deal with this different format and none of the people involved were trained to deal with that situation.

Update: Here something that was recently posted on the Blender Bug Tracker.
enter image description here

$\endgroup$
1
  • $\begingroup$ Thanks for the explanation :) but this is a little too much theory to be the accepted answer - looking for a more specific answer with tests to back it up :) Oh and that's a great metaphor, though we have some pretty fancy cranes these days. $\endgroup$
    – Greg Zaal
    Jul 23, 2014 at 6:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .