Well, the problems I was having went away when I changed from using state.light[0].position and specifying the light with the modelview set to identity, to program.env[0] and specified what I wanted myself as an eye space vector.
Now, Matt, you don’t need to worry about whether this is a bug of yours, 'cause it’s using a driver for some other hardware
Speaking of which: fragment.position is supposed to be in WINDOW space, right? xy is supposed to always be the same value for the same window pixel, according to how I read the spec.
That’s not what I’m getting. I’m getting something that is mostly object aligned. Unless I’m having a bug in my shader. Here it is, for everyone’s amusement. The intended output is to get a checkerboard pattern in window space:
static char const * errorFragmentProgramText =
"!!ARBfp1.0
\
PARAM colorb = { 1.0, 1.0, 0.0, 1 };
PARAM colora = { 0.2, 0.6, 0.6, 1 };
PARAM consts = { 2, 0.125, 0.5, 0 };
\
OUTPUT oCol = result.color;
\
TEMP tpos;
\
\
scale by 1/8; wrap
MUL tpos.xy, fragment.position, consts.yyww;
FRC tpos.xy, tpos;
\
\
offset to center around 0
SUB tpos.xy, tpos, consts.zzzz;
\
\
get halves or nothing
CMP tpos.xy, tpos, consts.zzzz, consts.wwww;
\
\
add both into result and trim off wholes
ADD tpos.x, tpos.x, tpos.y;
FRC tpos.x, tpos.x;
\
\
scale by 2 and lerp to choose color
MUL tpos.x, tpos.x, consts.x;
LRP tpos, tpos.xxxx, colora, colorb;
MOV oCol, tpos;
\
END
";
(The “scale by 1/8” really ought to be “scale by 8” according to my understanding, too)
[This message has been edited by jwatte (edited 12-22-2002).]