Class SoVertexShader

All Implemented Interfaces:
SafeDisposable

public class SoVertexShader extends SoShaderObject
Node that defines a vertex shader. This node defines a vertex shader.

See SoShaderProgram for general information about using shaders and shader parameters.

See parent class SoShaderObject for details about using the inherited fields.

Notes:

  • Shader object nodes cannot be inserted directly in a scene graph.
    They must be added to the shaderObject field of an SoShaderProgram node.
  • Predefined GLSL variables.
    Open Inventor uses a compatibility profile context for rendering. So legacy GLSL predefined variables, for example gl_ModelViewMatrix, can be used in vertex shaders. However, if you use the GLSL "#version" directive in a shader, you should append the keyword "compatibility", for example: "#version 150 compatibility".
  • Shadows.
    To integrate with Open Inventor's shadow casting algorithm, vertex shaders should call the GLSL method OivSetupShadowVertex(). Please see SoShadowGroup for example code.

Limitations:

File format/default:

VertexShader {

    sourceProgram ""
    sourceType FILENAME
    isActive true
    parameter NULL
}

See Also:
  • Constructor Details

    • SoVertexShader

      public SoVertexShader()
      Constructor.
  • Method Details

    • isSupported

      public static boolean isSupported(SoShaderObject.SourceTypes sourceType)
      Calls isSupported(sourceType, (com.openinventor.inventor.misc.SoState)null).
    • isSupported

      public static boolean isSupported(SoShaderObject.SourceTypes sourceType, SoState state)
      Indicates if vertex shaders in the specified language are supported by your graphics board. When using a debug build of Open Inventor, some "no context available" warning messages may be generated. You can ignore them or see SoGLExtension for an example of using SoGLContext to avoid them.