[vtk-developers] hardware shaders

Tim Peeters T.Peeters at tue.nl
Mon Oct 17 04:39:54 EDT 2005


Hello,

I created some VTK classes for managing GLSL shaders to use in my own 
code a while ago. Today I found out that the VTK 5 sources include 
support for shaders. I have a remark on the vtkShaderProgram class. It 
has funtions {Get,Set}{Vertex,Fragment}Shader() and it seems that per 
shader program only one vertex and one fragment shader are supported. I 
do not know about Cg, but in GLSL there is no such limit. For example, a 
shader can be written with a function to do certain lighting 
calculations and other shaders can then use this function. In order to 
do this it needs to be possible to link more than one vertex and one 
fragment shader to a shader program.

Is there a reason for not having a more general 
{Add,Remove}Shader(vtkShader*) function instead of the current get and 
set methods for vertex and fragment shaders?

Regards,
Tim.



More information about the vtk-developers mailing list