On 10/24/2012 11:35 AM, Jason Daly wrote:
On 10/24/2012 05:28 AM, Daniel Schmid wrote:
Since the material code is unique within geometries, so actually I
would need to transfer it only once per Geometry. If I change to
BIND_OVERALL, the data is no longer transferred, or at least my
shader cannot detect it anymore. I thought i should maybe reduce the
VertexAttribArray (l_Array) to one single entry, but this doesn't
work either.
What is the correct way of passing general or common data, on a per
geometry (and not vertex) basis?
I don't think BIND_OVERALL is valid for generic attributes. Sergey's
right, use a Uniform.
Scratch that, I'm wrong...
From the man page for glVertexAttrib:
"If a generic vertex attribute bound to an attribute variable in a
vertex shader is not updated while the vertex shader is executing,
the vertex shader will repeatedly use the current value for the
generic vertex attribute."
So it seems that BIND_OVERALL should be working just fine.
--"J"
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org