When I set up a texture as float it works (color is written - BTW I'm doing voxelization):
glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA32F, width, height, depth, 0, GL_RGBA,GL_FLOAT,NULL);
then setting filtering...
then binding:
glBindImageTexture(0, textureID, 0, GL_TRUE, 0, GL_READ_WRITE, GL_RGBA32F);
writing:
layout(rgba32f ,binding = 0) uniform image3D geometryGrid;
...
imageStore(geometryGrid, index, ivec4(1.0)); //ivec4 or vec4, it works
reading:
uniform sampler3D geometryTexture;
...
vec4 g = texture(geometryTexture, geomCoords);
But I want to use an integer texture (so in future I can do binary voxelization and bitwise operations - each bit = slice in z direction). I set it up like that:
glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA, width, height, depth, 0, GL_RGBA, GL_INT, NULL);
then setting filtering...
then binding:
glBindImageTexture(0, textureID, 0, GL_TRUE, 0, GL_READ_WRITE, GL_RGBA32I);
writing:
layout(rgba32i ,binding = 0) uniform iimage3D geometryGrid;
...
imageStore(geometryGrid, index, ivec4(1.0));
reading (same as float):
uniform sampler3D geometryTexture;
...
vec4 g = texture(geometryTexture, geomCoords);
Then it's black. Whats wrong with that? There is sparse documentation about it. BTW The info that iimage
is for integer texture, uimage
is for unsigned int is actually nowhere to be found.
glGetError()
return any errors during the process? $\endgroup$