Jump to content
  • Advertisement
Sign in to follow this  
keym

[Cg] Passing arrays to vertex shader

This topic is 1978 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,
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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!