sized array of float as parameter to nvidia cg shader
I am trying to use Cg shaders to blend textures within a fragment shader. I want to set weights for each image that i would like to pass down to the shader as a uniform variable of float arrays. These weights are fixed array of floats that would be reset variably. Is this possible? I see there is a method cgGLSetParameterArray1f(CGparameter, int offset, int nelements, float* values) and a method CgSetActiveSize(CGparameter param, int size).
Even though i use these methods i get errors while creating the shader using CgCreateProgram().
Is it possible to do what i am trying to achieve and can someone give me or point me to a sample code? even rough snippets of code or pointers would do.
If this is accomplishable in glsl, then I surmise that there must be something similar in cg as well..so please let me know how its done in glsl too so that i can search for its counterpart in cg too
thanks a lot..