A code snippet from arbvp1 to glsl,need help

The code snippet ARBVP1 is
MAD result.zw, temp.x, {0.125, 0.125, 0.125, 0.125}, {0.0, 0.0, 0.0, 0.125};
I wann tranlate it to GLSL
result.zw = (temp.x * vec4(0.125, 0.125, 0.125, 0.125)+ vec4(0.0, 0.0, 0.0, 0.125)).xy
or
result.zw = (temp.x * vec4(0.125, 0.125, 0.125, 0.125)+ vec4(0.0, 0.0, 0.0, 0.125)).zw?
Which one above is correct? Thanks in advanced
Heron

result.zw = temp.xx * vec2(0.125,0.125) + vec2(0, 0.125);

or in slightly different form, but same result/operation:

result.zw = temp.x * 0.125 + vec2(0, 0.125);

Thanks :smiley:
Does that mean for arbvp1 MOV r0.zw ,r1 equal to r0.zw=r1.zw rather than r0.zw=r1.xy?

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.