[vtkusers] set Attributes and Uniforms in VTK7/OpenGL2

Haichao Miao miao at cg.tuwien.ac.at
Tue Aug 16 05:59:46 EDT 2016


Hi,

I have two meshes A and B, where the vertex coordinates of A should be 
assigned as texture coordinates of the B.

I use vtkOpenGLPolyDataMapper together with a custom vertex and fragment 
shader, without creating my own vtkShaderCache or vtkShaderProgram objects.
However, I do use a vtkTextureObject that creates and binds the texture. 
This works fine, when I set only A as input data for the mapper.

Now I want to send the vertex data of B to the shader program. There are 
some attributes such as vertexMC that I can use in the shader code, but 
I don't know where they are set. I guess I need to set some uniforms and 
attributes (specifically, the vertex coordinates of B), but don't know how.
Is there a way to get the currently used shader program and send some 
attributes and uniform variables to it?

Thanks for the help!

Cheers

Hai



More information about the vtkusers mailing list