Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: 3D texture and GL_LUMINANCE8

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2013
    Posts
    16

    Question 3D texture and GL_LUMINANCE8

    Hello

    With the code:

    Code :
    glTexImage3D(GL_TEXTURE_2D_ARRAY_EXT,0,GL_LUMINANCE8,512,512,2,0,GL_LUMINANCE,GL_UNSIGNED_BYTE,tex2Darray);

    (tex2Darray pointing to a GLubyte array of the right dimension 512*512*2 bytes)

    glGetError() gives the value 0x500 "GL_INVALID_ENUM"

    Is there a problem with arrays of 2D texture with GL_LUMINANCE8?

    Perhaps should I use glTexStorage3D() and glTexSubImage3D()? But what should be the "internalformat" of the first and the "format" and "type" of the second to accept GL_LUMINANCE8 texture?

    Thanks
    Cathy L.

  2. #2
    Junior Member Newbie
    Join Date
    Sep 2013
    Posts
    16
    Oops that's not the right place for this post, sorry for that, could anybody move it? Thanks ans sorry again :-[

  3. #3
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    490
    Quote Originally Posted by zedrummer View Post
    Is there a problem with arrays of 2D texture with GL_LUMINANCE8?
    Which version?
    • OpenGL 2 doesn't have GL_TEXTURE_2D_ARRAY_EXT (or GL_TEXTURE_2D_ARRAY).
    • GL_TEXTURE_2D_ARRAY_EXT is only available if the EXT_texture_array extension is available.
    • OpenGL 3 has GL_TEXTURE_2D_ARRAY but the core profile doesn't have GL_LUMINANCE or GL_LUMINANCE8.

    EXT_texture_array was written against 2.0, so if you have EXT_texture_array, I believe that it should work. In OpenGL 3 compatibility profile, it should work with GL_TEXTURE_2D_ARRAY.

  4. #4
    Junior Member Newbie
    Join Date
    Sep 2013
    Posts
    16

    Quote Originally Posted by GClements View Post
    Which version?
    • OpenGL 3 has GL_TEXTURE_2D_ARRAY but the core profile doesn't have GL_LUMINANCE or GL_LUMINANCE8.
    Hello
    Thanks for your answer.
    I'm switching old OpenGL 1 code to 3.3 and I didn't know that GL_LUMINANCE/8 was deprecated. Thanks to you, I discovered that. Now googling around, I found that the way to load 1-byte monochrome texture is to use GL_RED.

    Thanks again
    Cathy L.

Posting Permissions

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