[osg-users] uniform array passing to Shader question

2011-03-17 Thread Nan WANG
Hi, everyone I got a problem about passing uniform array to shader array. the problem is in my shader I have: Code: uniform vec3 vertDecals[8]; I have to pass uniform value from OSG to shader so how to create an uniform array in osg code and add 8 values that will be used in shader... I

Re: [osg-users] uniform array passing to Shader question

2011-03-17 Thread Sergey Polischuk
Hi, Nan You should use like: osg::Uniform* u = new osg::Uniform(osg::Uniform::FLOAT_VEC3, vertDecals, 8);//last parameter is array size u-setElement(0,osg::Vec3(0,0,0));//first parameter is array index u-setElement(1,osg::Vec3(0.5,0.5,0.5)); Cheers, Sergey. 17.03.2011, 17:53, Nan WANG