Sign in to follow this  
burana

GLSL and variable loop count on Nvidia

Recommended Posts

I have a problem with GLSL vertex program loops. They work fine when the loop count is constant - I guess the compiler unrolls them at compile-time. But I can't use uniforms or attribute variables as the loop count, it just ends up with a compile error. Any ideas how to get this to work? What I'm trying to do is skin&bone animation with a varying amount of bones per vertex. I have geforce 5700 ultra with driver version 6.1.7.7 Also, any info and pointers about known bugs with current GLSL implementations would be very welcome.

Share this post


Link to post
Share on other sites
You can do a loop where count is a uniform in vertex shader, but not in fragment shader. You might want to update drivers first (66.93 are latest official). What kind of error are you geting form compiler. Your program might break the instruction count limit.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
In vertex skinning it is not a good idea to use uniforms when weight amount varies per vertex not per object. If attribute variables could be used to define loop count then there would be some sense. Too bad that nVidia does not have full support for glsl. And their compiler itself has major bugs in it which makes shader development really painful.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this