Class GLSLShaderProgram


  • public class GLSLShaderProgram
    extends ShaderProgram
    The GLSLShaderProgram object is a concrete implementation of a ShaderProgram node component for the OpenGL GLSL shading language.
    Since:
    Java 3D 1.4
    See Also:
    SourceCodeShader
    • Constructor Detail

      • GLSLShaderProgram

        public GLSLShaderProgram()
        Constructs a GLSL shader program node component.
        TODO: ADD MORE DOCUMENTATION HERE.
    • Method Detail

      • setVertexAttrNames

        public void setVertexAttrNames​(java.lang.String[] vertexAttrNames)
        Description copied from class: ShaderProgram
        Sets the vertex attribute names array for this ShaderProgram object. Each element in the array specifies the shader attribute name that is bound to the corresponding numbered vertex attribute within a GeometryArray object that uses this shader program. Array element 0 specifies the name of GeometryArray vertex attribute 0, array element 1 specifies the name of GeometryArray vertex attribute 1, and so forth. The array of names may be null or empty (0 length), but the elements of the array must be non-null.
        Specified by:
        setVertexAttrNames in class ShaderProgram
        Parameters:
        vertexAttrNames - array of vertex attribute names for this shader program. A copy of this array is made.
      • getVertexAttrNames

        public java.lang.String[] getVertexAttrNames()
        Description copied from class: ShaderProgram
        Retrieves the vertex attribute names array from this ShaderProgram object.
        Specified by:
        getVertexAttrNames in class ShaderProgram
        Returns:
        a copy of this ShaderProgram's array of vertex attribute names.
      • setShaderAttrNames

        public void setShaderAttrNames​(java.lang.String[] shaderAttrNames)
        Description copied from class: ShaderProgram
        Sets the shader attribute names array for this ShaderProgram object. Each element in the array specifies a shader attribute name that may be set via a ShaderAttribute object. Only those attributes whose names that appear in the shader attribute names array can be set for a given shader program. The array of names may be null or empty (0 length), but the elements of the array must be non-null.

        TODO: finish this.

        Specified by:
        setShaderAttrNames in class ShaderProgram
        Parameters:
        shaderAttrNames - array of shader attribute names for this shader program. A copy of this array is made.
      • getShaderAttrNames

        public java.lang.String[] getShaderAttrNames()
        Description copied from class: ShaderProgram
        Retrieves the shader attribute names array from this ShaderProgram object.
        Specified by:
        getShaderAttrNames in class ShaderProgram
        Returns:
        a copy of this ShaderProgram's array of shader attribute names.
      • setShaders

        public void setShaders​(Shader[] shaders)
        Copies the specified array of shaders into this shader program. This method makes a shallow copy of the array. The array of shaders may be null or empty (0 length), but the elements of the array must be non-null. The shading language of each shader in the array must be SHADING_LANGUAGE_GLSL. Each shader in the array must be a SourceCodeShader.
        Specified by:
        setShaders in class ShaderProgram
        Parameters:
        shaders - array of Shader objects to be copied into this ShaderProgram
        Throws:
        CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
        java.lang.IllegalArgumentException - if the shading language of any shader in the shaders array is not SHADING_LANGUAGE_GLSL.
        java.lang.ClassCastException - if any shader in the shaders array is not a SourceCodeShader.
        java.lang.NullPointerException - if any element in the shaders array is null.
      • getShaders

        public Shader[] getShaders()
        Description copied from class: ShaderProgram
        Retrieves the array of shaders from this shader program. A shallow copy of the array is returned. The return value may be null.
        Specified by:
        getShaders in class ShaderProgram
        Returns:
        a copy of this ShaderProgram's array of Shader objects