This code was developed and tested on an Nvidia card (GeForce.. works without a hitch in there) and when tested in an ATI 9600XT it gives a parser error:
Error on line 11: malformed declaration (hint: ''program'')
here''s the Vertex Program source:
!!ARBvp1.0
ATTRIB iPos = vertex.position;
ATTRIB iTex = vertex.texcoord[0];
ATTRIB iColor = vertex.color;
OUTPUT oPos = result.position;
OUTPUT oTex = result.texcoord[0];
OUTPUT oColor = result.color;
PARAM mvp[4] = { state.matrix.mvp };
PARAM lightpos[1] = { program.local[0] };
PARAM lightintensity[1] = { program.local[1] };
PARAM lightcolor[1] = { program.local[2] };
TEMP tColor;
TEMP rRSQ;
TEMP xmx,fm,suma;
DP4 oPos.x, mvp[0], iPos;
DP4 oPos.y, mvp[1], iPos;
DP4 oPos.z, mvp[2], iPos;
DP4 oPos.w, mvp[3], iPos;
SUB xmx, iPos, lightpos[0];
MUL fm, xmx, xmx;
ADD suma.x, suma.x, fm.x;
ADD suma.x, suma.x, fm.y;
ADD suma.x, suma.x, fm.z;
RSQ rRSQ, suma.x;
MUL rRSQ, rRSQ, lightintensity[0];
SUB tColor, rRSQ, lightcolor[0];
#SUB tColor, -lightcolor[0], -rRSQ;
MIN tColor, tColor, lightcolor[0];
MOV oColor.xyz, tColor;
MOV oColor.w,iColor.w;
MOV oTex, iTex;
END
line 11 is:
PARAM lightpos[1] = { program.local[0] };
i tried playing with spaces, to no avail
any ideas?
and any suggestion for developing shaders across brands?
this is kind of annoying
-Madster