[vtk-developers] Multiple sets of texture coordinates with OpenGL2 backend

Simon Drouin drouin.simon at gmail.com
Tue Dec 19 23:32:58 EST 2017


Is there any way to have multiple sets of texture coordinates on a
vtkPolyData with the OpenGL2 backend?

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:

polyData->GetPointData()->AddArray( tcoordArray )

And then associating the array to one of the textures with:

polyDataMapper->MapDataArrayToMultiTextureAttribute( textureUnit, arrayName
);

This behavior is not implemented in the OpenGL2 backend. The mapper
considers only the array returned by polyData->GetPointData()->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.

Any solution?

Thanks in advance.

s.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://vtk.org/pipermail/vtk-developers/attachments/20171219/0cd525ab/attachment.html>


More information about the vtk-developers mailing list