k.arts
07-04-2005, 05:00 PM
Hi there!
I am trying the following in cg:
float Max[10];
float Index = OtherValue*255.0f;
Max[Index] = Val;
I know, that Index is in range (Val between 0-9), but sadly the compiler doesn't know this... Thus he gives me an error. I tried to do also the following:
float Max[10];
float Index = OtherValue*255.0f;
Max[clamp(Index,0,9)] = Val;
That didn't work either, because clamping seems to be not allowed when indexing.
Is there any solution? I tried with the vp30, vp40 and of course with arbvp1 shaderprofile.
Thanks a lot
k.arts
I am trying the following in cg:
float Max[10];
float Index = OtherValue*255.0f;
Max[Index] = Val;
I know, that Index is in range (Val between 0-9), but sadly the compiler doesn't know this... Thus he gives me an error. I tried to do also the following:
float Max[10];
float Index = OtherValue*255.0f;
Max[clamp(Index,0,9)] = Val;
That didn't work either, because clamping seems to be not allowed when indexing.
Is there any solution? I tried with the vp30, vp40 and of course with arbvp1 shaderprofile.
Thanks a lot
k.arts
