Re: Problems using OCIO with QT and QtOpenGLWidget

Patrick Hodoul

Hi Haggi,
The thread disappeared from stackoverflow so I do not have access to all the source code anymore.

vec4 col = texture3D(tex1, vec3(, 0));
The default implementation from ociodisplay is tex1 for the image texture (the 2D texture), and tex2 for the 3D LUT texture (the 3D texture).

Here is the default GLSL ociodisplay fragment shader code:
    // Generated by OpenColorIO
    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.00390625, 0.00390625, 0.00390625));
    out_pixel.rgb = vec3(1.4427, 1.4427, 1.4427) * log(out_pixel.rgb) + vec3(0, 0, 0);
    out_pixel = vec4(0.0769231, 0.0769231, 0.0769231, 1) * out_pixel;
    out_pixel = vec4(0.615385, 0.615385, 0.615385, 0) + out_pixel;
    out_pixel.rgb = texture3D(lut3d, 0.96875 * out_pixel.rgb + 0.015625).rgb;
    return out_pixel;
    uniform sampler2D tex1;
    uniform sampler3D tex2;
    void main()
        vec4 col = texture2D(tex1, gl_TexCoord[0].st);
        gl_FragColor = OCIODisplay(col, tex2);

Using the wrong sampler could be an explanation as well as not binding resources. In plain OpenGL, the code for the latter is:
    glUniform1i(glGetUniformLocation(g_program, "tex1"), 1);
    glUniform1i(glGetUniformLocation(g_program, "tex2"), 2);

There is another similar thread on stackoverflow, is that the same problem?


Join to automatically receive all group messages.