0
\$\begingroup\$

Was it okay to use Texture.setEnforcePotImages(false) in order to disable conditional width and height pixel size that requires power of 2? I'm planning to sell the game app at Google Play. I want to know and make sure that most of the latest models and Android OS's that won't display faulty white images by estimation, depending how many smartphone owners have latest Android OS's. (Gingerbread, ICS, or Jellybean) I had updated my LibGDX library.

\$\endgroup\$
  • \$\begingroup\$ Any specific reason you don't want to use pot textures just to be on the safe side? \$\endgroup\$ – Mario Nov 29 '13 at 8:47
  • \$\begingroup\$ Instead of making images that has required the power of 2, I just want to apply an internal directory of image file in any width and height in pixels as is. \$\endgroup\$ – David Dimalanta Nov 29 '13 at 8:58
1
\$\begingroup\$

GL (and most other graphics acceleration libraries) specifies power of 2 size so that sampling operations just need shifts and additions

using any other size will replace that with a floating point multiplication which is much slower,

what you can do is resample the images when they load so they become a power of 2 size, this may introduce artifacts in the image so it is better to start from a power of 2 size

\$\endgroup\$
  • \$\begingroup\$ So you say that if I use images that is not power of 2, then it's getting slower? Is the white image the cause when gets slower? \$\endgroup\$ – David Dimalanta Nov 29 '13 at 10:23
  • \$\begingroup\$ non-power of 2 images are not supported in the first place and GL defaults to a white 1*1 pixel \$\endgroup\$ – ratchet freak Nov 29 '13 at 10:30
  • \$\begingroup\$ Is it possible that even with the latest device, specs, and Android OS version will might be display white images? Therefore, it must be power of 2 instead just to be safe? \$\endgroup\$ – David Dimalanta Nov 30 '13 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.