<div dir="ltr">Have you tried?<div><br></div><div><div>  /**</div><div>   * Select a data array from the point/cell data</div><div>   * and map it to a generic vertex attribute.</div><div>   * vertexAttributeName is the name of the vertex attribute.</div><div>   * dataArrayName is the name of the data array.</div><div>   * fieldAssociation indicates when the data array is a point data array or</div><div>   * cell data array (vtkDataObject::FIELD_ASSOCIATION_POINTS or</div><div>   * (vtkDataObject::FIELD_ASSOCIATION_CELLS).</div><div>   * componentno indicates which component from the data array must be passed as</div><div>   * the attribute. If -1, then all components are passed.</div><div>   */</div><div>  virtual void MapDataArrayToVertexAttribute(</div><div>    const char* vertexAttributeName,</div><div>    const char* dataArrayName, int fieldAssociation, int componentno = -1);</div></div><div><br></div><div><br></div><div>You will need to do something with that attribute in the shader code. I believe only point association is supported.  All textures will automatically get bound in order with names starting with texture_0 and going up.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 19, 2017 at 11:32 PM, Simon Drouin <span dir="ltr"><<a href="mailto:drouin.simon@gmail.com" target="_blank">drouin.simon@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Is there any way to have multiple sets of texture coordinates on a vtkPolyData with the OpenGL2 backend?<br><br>In the legacy OpenGL backend, it used to be possible to have multiple sets of texture coordinates on a vtkPolyData by adding multiple arrays, each containing a set of texture coordinates, to the point data of the polydata, by doing something like this:<br><br>polyData->GetPointData()-><wbr>AddArray( tcoordArray )<br><br>And then associating the array to one of the textures with:<br><br>polyDataMapper-><wbr>MapDataArrayToMultiTextureAttr<wbr>ibute( textureUnit, arrayName );<br><br>This behavior is not implemented in the OpenGL2 backend. The mapper considers only the array returned by polyData->GetPointData()-><wbr>GetTCoord() as texture coordinates and uses it for all textures. Initially, I thought I could do the job by modifying the shader program used to render the polydata, but the mapper doesn't seem to pack the extra arrays from the point data into the VBO, so the data is not there for the shader.<div><br></div><div>Any solution?</div><div><br></div><div>Thanks in advance.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>s.<br><br></div></font></span></div>
<br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://vtk.org/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">https://vtk.org/mailman/<wbr>listinfo/vtk-developers</a><br>
<br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Ken Martin PhD<div>Distinguished Engineer<br><span style="font-size:12.8px">Kitware Inc.</span><br></div><div>28 Corporate Drive<br>Clifton Park NY 12065<br><div><br></div><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">This communication,
including all attachments, contains confidential and legally privileged
information, and it is intended only for the use of the addressee.  Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken in reliance on it is prohibited and may be
unlawful. If you received this communication in error please notify us
immediately and destroy the original message. 
Thank you.</span></div></div></div></div></div>
</div>