Profile does not support "for"... any work-around?

Is there such a thing? I’m trying to write a fragment shader that requires a varying variable from the vertex shader for use in a loop. My card doesn’t seem to support any form of looping with uniform or varying variables. Is three any way I can get around this? If it’s of any help, I have a nVidia 5500FX w/256 mem.

GF5 doesn’t support dynamically calculated loop counts. IIRC you could set the loop count to the maximum possible loop count and put a conditional inside the loop to determine whether it needs to e executed.


uniform loop_count;

for (int i = 0; i < max_loop_count; ++i)
{
    if (i < loop_count)
    {
       function(i)
    }
}

Yeah, i see. Thanks. I was hoping there was something else, but I guess not. Oh well… at least that works. :wink:

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