Results 1 to 4 of 4

Thread: Loading ETC textures in OpenGL ES 2.0

  1. #1
    Junior Member
    Join Date
    Feb 2009
    Posts
    3

    Loading ETC textures in OpenGL ES 2.0

    Hi,

    I'm trying to load an ETC compressed texture and I'm not having luck with that format at the moment. I have not been able to find any related examples on how to load the texture once it's been compressed by etcpack. Do you have to exclude the small header ( magic number and version ) and send the rest of the data down ?

    I'm currently doing the compression in memory using the etcpack code. I modified the function compressImageFile to compress to a buffer. I'm then sending using that buffer to load into gl. So far all my textures have turned out with no data. Does anybody manage to get that tool to work ?

    Cheers,
    Dan.

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

    Re: Loading ETC textures in OpenGL ES 2.0

    I am not familiar with the format etcpack produces, but yes, you need to exclude any header data and pass only the raw block data for each mip level to glCompressedTexImage2D. The data size for each mip level is 8 * (level width / 4, rounded up) * (level height / 4, rounded up). In case you are not using mipmaps make sure you set the minification filter to GL_LINEAR or GL_NEAREST, otherwise GL will treat your texture as incomplete.

    Here is some code showing how to load ETC textures:
    viewtopic.php?p=3780#p3780

    By the way, the PowerVR OpenGL ES SDK comes with a texture tool that can generate ETC compressed textures, and loader code for the resulting file format.
    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

  3. #3
    Junior Member
    Join Date
    Feb 2009
    Posts
    3

    Re: Loading ETC textures in OpenGL ES 2.0

    Hi,

    Thanks for your answer. I have downloaded the new OpenGL ES 2.0 SDK but due to time contraints I might not be able to integrate it in our development environment.

    Following your answer I'm pretty sure I'm doing everything correctly but it still doesn't seem to work either in Windows using your emulation or on the prototype board I'm developping for. This leaves me with a few questions :
    1) Ericsson's tools website has a tool called etcpack. Does anyone know if the output of that tool is a valid ETC texture ?
    2) I'm using an old PowerVR SDK where the libGLESv2.dll contains the symbols for elg and gl. Does it correctly support ETC ?
    3) Ok if I understand you correctly, the content of the pkm file which is the output of the etcpack tool is like this :
    Magic number
    version
    texture type
    texture size
    texture extended size
    texture data
    So I'm only supposed to load the texture data with the call to glCompressedTexImage2D. Correct ??

    Cheers,
    Dan.

  4. #4
    Junior Member
    Join Date
    Feb 2009
    Posts
    3

    Re: Loading ETC textures in OpenGL ES 2.0

    Hi,

    Well to answer my own questions :
    1) The tool works fine.
    2) This old SDK supports ETC.
    3) You have to discard everything except the texture data.

    Problem fixed.

    Cheers,
    Dan.

Similar Threads

  1. problem loading textures with javascript (beginner)
    By campim in forum Developers Coding:Beginner
    Replies: 0
    Last Post: 06-19-2012, 03:59 PM
  2. The problem with loading dxt-comressed textures
    By Liberty_2000 in forum OpenGL ES general technical discussions
    Replies: 0
    Last Post: 02-03-2005, 08:48 PM

Posting Permissions

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