Package javax.media.j3d
Class GLSLShaderProgram
java.lang.Object
javax.media.j3d.SceneGraphObject
javax.media.j3d.NodeComponent
javax.media.j3d.ShaderProgram
javax.media.j3d.GLSLShaderProgram
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:
-
Field Summary
Fields inherited from class javax.media.j3d.ShaderProgram
ALLOW_NAMES_READ, ALLOW_SHADERS_READ
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]
Retrieves the shader attribute names array from this ShaderProgram object.Shader[]
Retrieves the array of shaders from this shader program.String[]
Retrieves the vertex attribute names array from this ShaderProgram object.void
setShaderAttrNames
(String[] shaderAttrNames) Sets the shader attribute names array for this ShaderProgram object.void
setShaders
(Shader[] shaders) Copies the specified array of shaders into this shader program.void
setVertexAttrNames
(String[] vertexAttrNames) Sets the vertex attribute names array for this ShaderProgram object.Methods inherited from class javax.media.j3d.NodeComponent
cloneNodeComponent, cloneNodeComponent, duplicateNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences
-
Constructor Details
-
GLSLShaderProgram
public GLSLShaderProgram()Constructs a GLSL shader program node component.
TODO: ADD MORE DOCUMENTATION HERE.
-
-
Method Details
-
setVertexAttrNames
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 classShaderProgram
- Parameters:
vertexAttrNames
- array of vertex attribute names for this shader program. A copy of this array is made.
-
getVertexAttrNames
Description copied from class:ShaderProgram
Retrieves the vertex attribute names array from this ShaderProgram object.- Specified by:
getVertexAttrNames
in classShaderProgram
- Returns:
- a copy of this ShaderProgram's array of vertex attribute names.
-
setShaderAttrNames
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 classShaderProgram
- Parameters:
shaderAttrNames
- array of shader attribute names for this shader program. A copy of this array is made.
-
getShaderAttrNames
Description copied from class:ShaderProgram
Retrieves the shader attribute names array from this ShaderProgram object.- Specified by:
getShaderAttrNames
in classShaderProgram
- Returns:
- a copy of this ShaderProgram's array of shader attribute names.
-
setShaders
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 beSHADING_LANGUAGE_GLSL
. Each shader in the array must be a SourceCodeShader.- Specified by:
setShaders
in classShaderProgram
- 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 graphIllegalArgumentException
- if the shading language of any shader in the shaders array is notSHADING_LANGUAGE_GLSL
.ClassCastException
- if any shader in the shaders array is not a SourceCodeShader.NullPointerException
- if any element in the shaders array is null.
-
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 classShaderProgram
- Returns:
- a copy of this ShaderProgram's array of Shader objects
-