[osg-users] osg::Vec3Array as uniform to Shader

2018-03-03 Thread Rômulo Cerqueira
Hi, can I pass a osg::Vec3Array as uniform to Shader? ... Thank you! Cheers, Rômulo -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=73010#73010 ___ osg-users mailing list osg-users@lists.openscene

Re: [osg-users] osg::Vec3Array as uniform to Shader

2018-03-03 Thread Rômulo Cerqueira
Hi, I found a way to solve this problem: converting the array to texture. Follows an example: Code: osg::ref_ptr image = new osg::Image; image->setImage(myVec3Array->size(), 1, 1, GL_RGBA8, GL_RGBA, GL_FLOAT, (unsigned char*) &myVec3Array[0], osg::Image::NO_DELETE); osg::ref_ptr texture = ne

Re: [osg-users] osg::Vec3Array as uniform to Shader

2018-03-04 Thread Robert Osfield
The three options you have are : To use the array support in osg::Uniform that enables use of array of Vec3, It internally manages the array so you can't just pass in an osg::Vec3Array, by you have setNumElements/setElement(..) methods. To use an float RGB osg::Image like you have done

Re: [osg-users] osg::Vec3Array as uniform to Shader

2018-03-05 Thread Rômulo Cerqueira
Thanks, Robert. ... Thank you! Cheers, Rômulo -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=73022#73022 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.or