Results 1 to 5 of 5

Thread: glteximage2D with odd width and height possible or not?

  1. #1
    Junior Member
    Join Date
    Oct 2010
    Posts
    7

    glteximage2D with odd width and height possible or not?

    Hi,

    Could anyone of you please let me know, is it possible to specify odd number of width and height(i.g. 555x555) or not?

    Thanks

  2. #2
    Senior Member
    Join Date
    May 2010
    Posts
    207

    Re: glteximage2D with odd width and height possible or not?

    No. In OpenGL-ES, textures have to be an exact power of two in each direction (1,2,4,8,16,32,64,128,256,512,1024...maybe 2048 and 4096) - although they can be rectangular (eg 32x128 or 512x64).

    Mainstream desktop OpenGL allows non-power-of-two ("NPOT") textures in the more recent releases...but not OpenGL-ES.

  3. #3
    Senior Member
    Join Date
    May 2006
    Posts
    353

    Re: glteximage2D with odd width and height possible or not?

    OpenGL ES 2.0 supports non-power-of-two textures, but with restrictions (no mipmaps, wrap mode must be GL_CLAMP_TO_EDGE). If OES_texture_npot is supported, those restrictions no longer apply.

    APPLE_texture_2D_limited_npot allows the same in OpenGL ES 1.1.
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

  4. #4
    Senior Member
    Join Date
    May 2010
    Posts
    207

    Re: glteximage2D with odd width and height possible or not?

    Yeah - sorry - you're right.

    There are indeed some very specific conditions in which non-power-of-two is OK in OpenGL ES 2.x ...but not in general, and not in OpenGL ES 1.x. You can't just use an odd sized map anywhere you can use a power-of-two-sized map.

    For details, read:

    http://www.khronos.org/registry/gles/sp ... 2.0.24.pdf

    ...specifically, sections 3.7.11 and 3.8.2.

    -- Steve

  5. #5
    Junior Member
    Join Date
    Jan 2011
    Posts
    1

    Re: glteximage2D with odd width and height possible or not?

    For the record on some ES2 devices I could use textures with odd dimensions using GL_UNSIGNED_BYTE and GL_RGBA however texture mapping would get broken when using GL_LUMINANCE_ALPHA with odd dimensions texture. I observed that behavior on WinXP running PowerVR emulator on an NVidia card and on a Freescale i.MX51 board running WinCE. Using GL_RGBA or rounding up your dimensions to an even number fixes the issue.

Similar Threads

  1. Generating Textureless Terrain Height Data From Heightmap
    By Glynbeard in forum Developers Coding:Beginner
    Replies: 0
    Last Post: 05-31-2012, 01:46 PM
  2. Something odd
    By kavi in forum Developers Coding:Beginner
    Replies: 0
    Last Post: 11-07-2011, 03:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •