Which function do I use by defining the float2 array in shader code
Which function do I use by defining the float2 array in shader code?
In shader code,I define a array of float2 called SeedPos,as below:
float2 SeedPos[10];
But I in the c++, I do not know which function should I use to send data to shader, SetVector or SetArray?
SetVector is 4-dimensions
SetFloatArray is One-dimension
The float2 is 2-dimensions.
[Edited by - akira32 on July 11, 2008 8:11:43 AM]
there is a method called SetFloatArray ( http://msdn.microsoft.com/en-us/library/bb205717(VS.85).aspx )
You can use either. I think that float2 takes up 4 floats of storage anyway, or is at least aligned as such. When using SetVector it'll effectively just use the first two values. SetArray with a length of two works just as well.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement