PDA

View Full Version : ARB_fragment_program



Dodger
04-16-2003, 10:34 AM
I'm having a bit of a problem with getting it to work on my nifty new 9700 pro. Everything works fine as long as fragment program mode is disabled. However, as soon as I enable fp, nothing at all seems to be written to the framebuffer. Of course, the first thing I suspected was my fragment program, which I then stripped down to the following:


!!ARBfp1.0
OUTPUT outColor=result.color;
PARAM white={1.0, 1.0, 1.0, 1.0};
MOV outColor.rgba, white;
END

In other words, simply write white pixels. Still, enabling fragment programs makes the mesh on screen disappear. The program is loaded and assembled by the driver without any error or warning messages. glGetError returns GL_NONE, everything seems to be fine.
I suspect it's some really stupid error that I'm just not seeing. Any ideas?

Thanks!

Ostsol
04-16-2003, 10:39 AM
You shouldn't have to provide a mask for output, in this case. Simply having. . .

MOV outColor, white;

. . . should work fine.

Dodger
04-16-2003, 10:42 AM
Thanks for the reply Ortso - I originally had it without mask, and that doesn't work either.
It almost seems like there's no processing done at all when fp mode is enabled.

roffe
04-16-2003, 10:58 AM
When you say loaded and assembled, you mean loaded and bound?

Try downloading some fp demo and see if it works. If the demo comes with src, "strip down" the demo until it does what your program does.Tedious but effective.

Dodger
04-16-2003, 11:39 AM
Several FP Demos I tried work for me - I downloaded Humus' reflection/refraction demo and it worked (even if it didn't look quite right), and Shadows That Don't Suck. Seems that I'm setting some state in a way that FP doesn't like, since no matter what I put into my fragment program, there is no output when enabled.

[This message has been edited by Dodger (edited 04-16-2003).]

Zeno
04-16-2003, 12:19 PM
You've probably already done most of these checks, but just on the off chance that you missed one:

Are you getting any errors when you load the program string? Do you have alpha test off? Stencil test off? Not doing any color masking? Are you sure that the geometry you're drawing is visible? You're not clearing the screen after you draw with your FP but before swap buffers? Or forgetting to clear the depth buffer? Do you have black fog enabled but neglect to write to result.fogcoord?

-- Zeno