Hi Cedric,

I used the addBindAttribLocation to the program but it generated an
error. Because the compiling of the program gave another location to put
my data. Anyway i will a another try to test it.

I've been using addBindAttribLocation in my software for a while, so I know it works.

It basically just associates a name to an attribute number, so just make sure you use an unused attribute location (like 9+ for example, just to be safe) and then use that name in your shader, and use that number when adding an attribute array to your osg::Geometry. As long as you call addBindAttribLocation before the shader is compiled and linked, it works well (I had that problem at one point, I was calling it from a callback after the shader had been compiled, and I would get undefined data in my shader instead of the data I was putting in the arrays).

In my Masters project I was storing Spherical Harmonics coefficients in 7 consecutive Vec4 attribute arrays (I needed 25 floats) and it worked well. In our software here at CM-Labs we just use one attribute array right now, but it works equally well.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    [email protected]
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to