Two simple examples of applying custom shader code to a VTK object. These examples demonstrate two methods of customizing shaders with the vtkOpenGLPolyDataMapper
. The first method modifies the existing shader using AddShaderReplacement
. The second method injects a custom shader using SetVertexShaderCode
and SetFragmentShaderCode
. Requires VTK >=7.0.
This example borrows from:
- http://www.vtk.org/Wiki/VTK/Examples/Python/Cylinder
- http://www.vtk.org/Wiki/Shader_In_VTK
- https://gitlab.kitware.com/vtk/vtk/blob/v7.0.0.rc2/Rendering/OpenGL2/Testing/Cxx/TestUserShader.cxx
See also: