imageStore when internal format is GL_LUMINANCE16

Hi

I have a 3D texture



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:


glBindImageTextureEXT(0,ID,0,GL_FALSE,0,GL_READ_WRITE,GL_RGBA16f);

Inside the shader:


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

[QUOTE=driver;1255241]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?[/QUOTE]
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.