Sign in to follow this  

[Cg] Passing arrays to vertex shader

Recommended Posts

I'm trying to write a vertex skinning shader and I'm having troubles passing any type of array to vertex shader.

Let's say I have a global array in vertex shader like this:
float ar[2];

In my application let's say I create simple array:
float v2[2]={1, 0.5f};

And then I try to pass it over like this:
cgSetParameter1fv(this->cgManager.test_array, v2);

When I do this I get "Invaild parameter handle" error. test_array parameter is binded correctly like any other non-array uniform (when I try the same thing with single variables it works). Does arrays need extra steps? How would I upload values into it?

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