So I was able to find out that the 3d texture behaves correctly as much as I can say. At least if I fill it with random values and read it in the fragment shader with:
vec4 col = texture3D(tex1, vec3(vTexCoord.st, 0));
I get the expected results. So if I now use the ocio generated shader I get an GL_INVALID_OPERATION during drawing. The problem lies here:
vec4 OCIODisplay(vec4 inPixel,
sampler3D lut3d)
{
vec4 out_pixel = inPixel;
out_pixel.rgb = max(vec3(1.17549e-38, 1.17549e-38, 1.17549e-38), vec3(1, 1, 1) * out_pixel.rgb + vec3(0, 0, 0));
out_pixel.rgb = vec3(1.4427, 1.4427, 1.4427) * log(out_pixel.rgb) + vec3(0, 0, 0);
out_pixel = vec4(0.047619, 0.047619, 0.047619, 1) * out_pixel;
out_pixel = vec4(0.714286, 0.714286, 0.714286, 0) + out_pixel;
out_pixel.rgb = texture3D(lut3d, 0.96875 * out_pixel.rgb + 0.015625).rgb;
return out_pixel;
}
The line:
out_pixel.rgb = texture3D(lut3d, 0.96875 * out_pixel.rgb + 0.015625).rgb;
produces the GL_INVALID_OPERATION error. If I exchange the
0.96875 * out_pixel.rgb + 0.015625
with something like vec3(.5, .5, .5) I get no error and a solid color as expected. So now I have no idea what I can do.