Hi Paul,
Thanks for the troubleshooting tips! I am providing an array of floats, 4 wide for RGBA, and 65536 long for a 16-bit deep image.
I just walked through my shader and simply replaced the red channel with a '1.0' to see if I can get it to do something. This works just fine. I have a very red image in Motion 5.
uniform sampler2DRect ImageTexture; uniform sampler1D LinearLUT;
void main() { vec4 inputColor = texture2DRect(ImageTexture, gl_TexCoord[0].st); inputColor.r = 1.0; gl_FragColor = inputColor;
// Linearize Image Data with LUT //inputColor.r = texture1D(LinearLUT, inputColor.r).r; //inputColor.g = texture1D(LinearLUT, inputColor.r).g; //inputColor.b = texture1D(LinearLUT, inputColor.r).b; }
It seems as though the problem is with the LUT.
bob..
On Jul 20, 2011, at 8:31 AM, Paul Schneider wrote:
Hi Bob,
You are telling GL that the LUT is 32-bit float here, so it will expect floats.
glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA, 65536, 0, GL_RGBA, GL_FLOAT, [[colorObj preLUTObj] glLUTFData]);
If you'd prefer to upload half floats, you can probably use GL_HALF_FLOAT instead of GL_FLOAT for the "format" parameter.
In general, since it's tough to step through what's happening on the GPU, I find it useful to start simple and layer on complexity. For example, you could start by drawing a red quad with no texture/shader, just to make sure you're drawing the rectangle in the right place. Then you could apply a very simple shader that just colors it blue. Then you can layer on complexity from there until you find the step that isn't working.
|