<div dir="ltr"><div dir="ltr">On Wed, 10 Mar 2021 at 15:35, Werner Modenbach <<a href="mailto:Werner.Modenbach@modenbach-ac.de">Werner.Modenbach@modenbach-ac.de</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
Hi Robert,<br>
<br>
I had a look at the code in osg::Geometry. The lines in question
are:<br>
<br>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">handleVertexAttributes</span><span style="color:rgb(192,192,192)"> </span>)
<span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">for</span>(<span style="color:rgb(128,128,0)">unsigned</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">int</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">index</span><span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0</span>;<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">index</span><span style="color:rgb(192,192,192)"> </span><<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">_vertexAttribList</span>.<span style="color:rgb(0,103,124)">size</span>();<span style="color:rgb(192,192,192)"> </span>++<span style="color:rgb(9,46,100)">index</span>)</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">const</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">Array</span>*<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">array</span><span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">_vertexAttribList</span>[<span style="color:rgb(9,46,100)">index</span>].<span style="color:rgb(0,103,124)">get</span>();</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(9,46,100)">array</span><span style="color:rgb(192,192,192)"> </span>&&<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">array</span>-><span style="color:rgb(0,103,124)">getBinding</span>()==<span style="color:rgb(128,0,128)">osg</span>::<span style="color:rgb(128,0,128)">Array</span>::<span style="color:rgb(128,0,128)">BIND_PER_VERTEX</span>)</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">vas</span>-><span style="color:rgb(0,103,124)">setVertexAttribArray</span>(<span style="color:rgb(9,46,100)">state</span>,<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">index</span>,<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">array</span>);</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)"> </span>}</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)"> </span>}</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)"> </span>}</pre>
<pre style="margin:0px;text-indent:0px"></pre>
Do you remember, why the condition <br>
getBinding() == BIND_PER_VERTEX<br>
is there?<br>
<u>But(!) </u>the same condition is at _normalArray, _colorArray
etc. and they are handled correct with BIND_OVERALL.<br>
<br>
I don't understand what is really done there. Sorry.<br></div></blockquote><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>Which version of the OSG are you using?<br></div><div><br></div><div>Cheers,<br></div><div>Robert.<br></div><div> </div></div></div>