I think that the result of this program is depend on nLoop but the result I got was similar to vec4(0.1, 0.0, 0.0, 0.0).
It seems that for-loop doesn’t works dynamically.
Does GLSL support dynamic loop like I used above ?
(Is this written in specification or FAQ ?
I didn’t find such description.)
Would you please give me some advice ?
Thanks.
P.S.
My execution environment is GeForce6800GT(AGP).
When I wrote same program in HLSL and executed, the result is similar to (0.1*N_LOOP, 0.0, 0.0, 0.0).
I changed code from 1.0f to 1.0, and executed program.
As a result, I got a correct result.
Then, I changed code from 1.0 to 1.0f for confirmation.
As a result, I got a correnct result, too.
I don’t understand why my code works correctly, but it is truth that result is correctly.
I hated to bother you about this.
The consequences of very long or non-terminating loops are platform dependent.
On your hardware, the max count loop is 255. If you exceed this limit, no error is generated but the results are undefined.