GLSL shader framework¶
Introduction¶
The SoShader modules facilitate the prototyping of OpenGL Shading Language (GLSL) algorithms. For detailed information on GLSL, please visit the OpenGL homepage.
The SoShader modules offer low-level access to fragment, vertex, and geometry shaders.
If you are looking for a higher-level approach to extensible GLSL shaders, refer to the GLSL Shader Pipeline
, which is built on top of the SoShader modules.
Hardware requirements¶
Depending on the OpenGL Shading Language features you wish to use, the requirements for graphics hardware and supported OpenGL version may vary. OpenGL 2.0 support is required at minimum.
Recommended hardware¶
We recommend a current OpenGL graphics board from either AMD or Nvidia.
Debugging¶
For additional debug outputs of the shader framework modules, set the IV_DEBUG_SHADER environment variable before launching MeVisLab.
Modules¶
SoCheckShaderSupport
- Checks the current graphics card driver for GLSL support.SoGeometryShader
- Accommodates a GLSL Geometry Shader object.SoVertexShader
- Accommodates a GLSL Vertex Shader object.SoFragmentShader
- Accommodates a GLSL Fragment Shader object.SoShaderProgram
- Links all vertex, geometry, and fragment shaders encountered so far.SoShaderParameter1f
- Provides a means to set a float floating-point uniform parameter.SoShaderParameter2f
- Provides a means to set a vec2 floating-point uniform parameter.SoShaderParameter3f
- Provides a means to set a vec3 floating-point uniform parameter.SoShaderParameter4f
- Provides a means to set a vec4 floating-point uniform parameter.SoShaderParameter1i
- Provides a means to set an int integer type uniform parameters.SoShaderParameter2i
- Provides a means to set an ivec2 integer type uniform parameters.SoShaderParameter3i
- Provides a means to set an ivec3 integer type uniform parameters.SoShaderParameterColor
- Sets a vec3 uniform parameter from a SoSFColor field.SoShaderParameterMatrix
- Sets a mat4 uniform parameter from a SoSFMatrix field.SoShaderParameterMLImageProperties
- Reads the SoMLImageElement from the Open Inventor state and provides the information as uniform parameters.SoShaderParameterMLImageSize
- Reads the SoMLImageElement from the Open Inventor state and provides access to the image size as an ivec3 uniform parameter.SoMLSampler1D
- Reads a 1D subimage for a ML image dataset and provides it as a GLSL sampler.SoMLSampler2D
- Reads a 2D subimage for a ML image dataset and provides it as a GLSL sampler.SoMLSampler3D
- Reads a 3D subimage for a ML image dataset and provides it as a GLSL sampler.SoMLSamplerCubeMap
- Reads six adjacent slices of an ML image dataset to provide it as a GLSL cubemap sampler.SoMLImageProperties
- Applies the ML image properties to the Open Inventor traversal state.SoFramebufferSampler2D
- Provides an OpenGL Framebuffer Object as a GLSL 2D sampler.SoFramebufferSampler3D
- Provides an OpenGL Framebuffer Object as a GLSL 3D sampler.SoMultiPassFramebufferSampler
- Allows for accumulating multiple render passes in a sampler.SoInheritedFramebufferSampler
- Accesses a previous OpenGL Framebuffer sampler.SoGoochShader
- Uses the SoShader C++ API to provide tone shading by means of the Gooch shader.SoClearShaderState
- Clears the Open Inventor traversal state from currently accumulated shader and uniform parameter modules.SoMultiplePass
- Allows multiple traversals of the attached subgraph.SoGLRenderState
- Modifies certain OpenGL state settings.