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 2 of 2

Thread: imageStore when internal format is GL_LUMINANCE16

  1. #1
    Intern Newbie
    Join Date
    Oct 2012
    Posts
    41

    imageStore when internal format is GL_LUMINANCE16

    Hi

    I have a 3D texture

    Code :
     
    glGenTextures(1, &ID);
      glBindTexture(GL_TEXTURE_3D,ID);
     
      glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, wrapX);
      glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, wrapY);
      glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, wrapZ);
      glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, iMagFilter);
      glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, iMinFilter);
     
     
     
      glTexImage3D(GL_TEXTURE_3D, 0, GL_LUMINANCE16,
                   SizeX,SizeY,SizeZ,
                   0,GL_LUMINANCE,GL_UNISIGNED_SHORT, (GLvoid*)data);

    Once thisis done, I use glBindImageTexture like so:
    Code :
    glBindImageTextureEXT(0,ID,0,GL_FALSE,0,GL_READ_WRITE,GL_RGBA16f);


    Inside the shader:
    Code :
    layout (binding=0,rgba16f) uniform image3D myVol;


    I am not having any problems in compiling , but when i use imageStore() to write to myVol, I am not seeing any results.
    Now, there could be other things wrong, but before i look further , i wanted to make sure the way I am representing the data is correct.

    GL_LUMINANCE16 means (L,L,L,1) wherre each component has the same value. So the number of bits in the internal represetation is 16 per channel , so 16*4 in total. That's why i used GL_RGBA16f in the image declaration in the shader.

    Is this correct?

    Another question - Also if a image has GL_LUMINANCE16 as internal format representation, what does a format type of GL_LUMINANCE mean? Is it 8 bits per channel?

    Another question- Can I bind the texture, specified by ID, to a texture unit at the same time as an image unit. My intention is that I will use the image unit to write to the texture using imageStore and then simply use the texture unit binding to see the new written values inside another shader using ray casting.

    thanks

  2. #2
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    474
    Quote Originally Posted by driver View Post
    I am not having any problems in compiling , but when i use imageStore() to write to myVol, I am not seeing any results.
    Now, there could be other things wrong, but before i look further , i wanted to make sure the way I am representing the data is correct.

    GL_LUMINANCE16 means (L,L,L,1) wherre each component has the same value. So the number of bits in the internal represetation is 16 per channel , so 16*4 in total. That's why i used GL_RGBA16f in the image declaration in the shader.

    Is this correct?
    GL_LUMINANCE and the sized versions thereof are deprecated. If you want a single-component texture, use GL_RED, and use swizzling to expand one component to three.

    Although GL_LUMINANCE still exists in the compatibility profile, I don't know whether it's valid to use such a texture as an image. Even if it is, I'm fairly sure that GL_RGBA16F is wrong, as each texel only has a single component. I'd be more inclined to try GL_R16F.

Tags for this Thread

Posting Permissions

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