Texture is Not a Power of Two

New to Moai? Get started here with our best tips and tutorials.

Texture is Not a Power of Two

Postby sgeos » Fri Jul 20, 2012 1:28 am

The Moai environment complains when I use a 480 by 480 pixel texture. Presumably all textures should just be a power of two to avoid problems?
Any original code posted by me is released via the CC0 Public Domain Dedication. It is in the public domain. Do whatever you want with it.
User avatar
sgeos
 
Posts: 241
Joined: Sat Apr 28, 2012 4:42 am
Location: Married in Japan.

Re: Texture is Not a Power of Two

Postby ibisum » Fri Jul 20, 2012 2:17 am

Yes. This is a common requirement when dealing with Open GL ES ..
;
--
ibisum@gmail.com
Got a MOAI snippet? Please consider adding it to http://moaisnippets.info
User avatar
ibisum
 
Posts: 1024
Joined: Mon Oct 17, 2011 1:11 am
Location: Vienna, Austria

Re: Texture is Not a Power of Two

Postby BlueByLiquid » Fri Jul 20, 2012 3:24 pm

sgeos wrote:The Moai environment complains when I use a 480 by 480 pixel texture. Presumably all textures should just be a power of two to avoid problems?


One common method practice is to pack multiple textures into one square texture reducing the wasted space considerably depending on the packing of the textures. There are a fair number of tools which will do this for you.
BlueByLiquid
 
Posts: 105
Joined: Fri May 11, 2012 8:54 pm

Re: Texture is Not a Power of Two

Postby sgeos » Fri Jul 20, 2012 4:49 pm

I'm using sprite sheets. The problem I am facing is supporting different screen resolutions. The iPod Touch 3G has a 480 by 320 screen, so using a 480 pixel version of the background on the iPod Touch is the naive optimized solution. Rolling that up to 512 is not a big deal:
Code: Select all
  1. image@512.png

  2. image@1024.png

  3. image@2048.png

Any original code posted by me is released via the CC0 Public Domain Dedication. It is in the public domain. Do whatever you want with it.
User avatar
sgeos
 
Posts: 241
Joined: Sat Apr 28, 2012 4:42 am
Location: Married in Japan.


Return to New Users

Who is online

Users browsing this forum: No registered users and 0 guests

x