Hi,
I try to read some data in a FBO (GL_TEXTURE_2D_ARRAY) that contains fragment normals and position to do defered shading in a compute shader.
All the data i read seems to be 0. My FBO is not empty and contains good datas when i display it and my fbo is correectly binded.
I try to acess it like this :
layout (binding=0) uniform sampler2D inColor;
layout (binding=1) uniform sampler2D inNormal;
....
void main(void)
{
const uint i= gl_GlobalInvocationID.x;
const uint x = i%1024;
const uint y = (i-x)/1024;
const ivec2 storepos = ivec2(x,y);//gl_GlobalInvocationID.xy);
vec2 coord = vec2(storepos)/vec2(1024.0);
vec4 pos = texture2D(inColor,coord);
vec4 norm = texture2D(inNormal,coord);
value[i] = queryHardShadow(pos,norm); //my wonderfull work xD
// value[i] = pos.x; always black if displayed
}
Any on have an idea?
Thanks!