Hi Gurus
In attempting to do some image processing I’ve an ARB fragment program I’d like to apply to a displayed image however have encountered some hurdles (for ref: Renderer : NVIDIA GeForce FX 5200 Ultra OpenGL Engine Version : 1.3 NVIDIA-1.3.28 under OSX 10.3.5)
Upon enclosing a drawPixels() with a glEnable/Disable(GL_FRAGMENT_PROGRAM_ARB) it appears that fragment.color.primary referenced within the fragment program, is consistently white (for fragments written by the drawPixels() ).
Take as example the following (very simple) fragment program.
!!ARBfp1.0
MOV result.color, fragment.color.primary;
...
Having read others’ woes as to similar situations with ARB fp & drawPixels on nVidia FX, I tried a little debugging & with the same ARB fragment program, managed to get it to function as expected when instead of drawPixels I wrote verticies, 1 for each “pixel” of the image, explicitly setting the color at each vertex (pixel).
glBegin(GL_POINTS);
glColor3f();
glVertex2f();
...
(ie, in the above case, fragment.color.primary contained the glColor3f set explicitly for each fragment).
Of course, drawing images as verticies, 1 pixel at a time is far from elegant (nor feasible, given performance constraints of playback) hence I ventured down the 3rd path of texturing a quad with my image using GL_TEXTURE_RECTANGLE_EXT, blatting it to the screen
glBegin(GL_QUADS);
glTexCoord2f();
glVertex2f();
...
and again enclosing the above quad in the glEnable/Disable(GL_FRAGMENT_PROGRAM_ARB) .
Though I verified the fragment program was working , again the fragment.color.primary was always white.
Given all the above, does anyone have any ideas as to what I may be doing wrong.
Thanks muchly