[osg-users] Question about array binding

Robert Osfield robert.osfield at gmail.com
Wed Mar 10 07:48:25 PST 2021


On Wed, 10 Mar 2021 at 15:35, Werner Modenbach <
Werner.Modenbach at modenbach-ac.de> wrote:

> Hi Robert,
>
> I had a look at the code in osg::Geometry. The lines in question are:
>
>     if ( handleVertexAttributes )    {
>
>         for(unsigned int index = 0; index < _vertexAttribList.size(); ++index)
>
>         {
>
>             const Array* array = _vertexAttribList[index].get();
>
>             if (array && array->getBinding()==osg::Array::BIND_PER_VERTEX)
>
>             {
>
>                 vas->setVertexAttribArray(state, index, array);
>
>             }
>
>         }
>
>     }
>
> Do you remember, why the condition
>             getBinding() == BIND_PER_VERTEX
> is there?
> *But(!) *the same condition is at _normalArray, _colorArray etc. and they
> are handled correct with BIND_OVERALL.
>
> I don't understand what is really done there. Sorry.
>

I'm pretty rusty with the code in question, but my guess is that this
constraint could be rather old, dating back to when vertex attribute
support was first added and mirrored the hardwiring of texture coordinates
to be per vertex.

I can't see any reason why this per vertex restriction would be needed
now.  Try the check against BIND_PER_VERTEX and see what happens.

Which version of the OSG are you using?

Cheers,
Robert.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20210310/0d2eb79d/attachment.html>


More information about the osg-users mailing list