Why do images for textures on the iPhone need to have power-of-two dimensions?

后端 未结 6 1136
伪装坚强ぢ
伪装坚强ぢ 2021-02-14 02:54

I\'m trying to solve this flickering problem on the iphone (open gl es game). I have a few images that don\'t have pow-of-2 dimensions. I\'m going to replace them with images

6条回答
  •  粉色の甜心
    2021-02-14 03:29

    Try implementing wrapping texture-mapping in software and you will quickly discover why power-of-2 sized are desirable.

    In short, you will find that if you can assume power-of-2 dimensions then a lot of integer multiplications and divisions turn into bit-shifts.

    I would hazard a guess that the recent trend in relaxing this restriction is due to GPUs moving to floating-point maths.

    Edit: The "because of mipmapping" answer is incorrect. Mipmapped, non-power-of-two textures are a common feature of modern GPUs.

提交回复
热议问题