[vtkusers] set Attributes and Uniforms in VTK7/OpenGL2

Haichao Miao miao at cg.tuwien.ac.at
Tue Aug 16 09:37:11 EDT 2016


Update, I think I got this. The uniforms can be set over the 
UpdateShaderEvent.

Thanks
Hai

Am 16.08.2016 um 11:59 schrieb Haichao Miao:
> 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
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: 
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers



More information about the vtkusers mailing list