javax.media.ding3d
Class SourceCodeShader

java.lang.Object
  extended by javax.media.ding3d.SceneGraphObject
      extended by javax.media.ding3d.NodeComponent
          extended by javax.media.ding3d.Shader
              extended by javax.media.ding3d.SourceCodeShader

public class SourceCodeShader
extends Shader

The SourceCodeShader object is a shader that is defined using text-based source code. It is used to define the source code for both vertex and fragment shaders. The currently supported shading languages are Cg and GLSL.

Since:
Java 3D 1.4
See Also:
ShaderProgram

Field Summary
 
Fields inherited from class javax.media.ding3d.Shader
SHADER_TYPE_FRAGMENT, SHADER_TYPE_VERTEX, SHADING_LANGUAGE_CG, SHADING_LANGUAGE_GLSL
 
Constructor Summary
SourceCodeShader(int shadingLanguage, int shaderType, java.lang.String shaderSource)
          Constructs a new shader object of the specified shading language and shader type from the specified source string.
 
Method Summary
 NodeComponent cloneNodeComponent()
          Deprecated. replaced with cloneNodeComponent(boolean forceDuplicate)
 java.lang.String getShaderSource()
          Retrieves the shader source string from this shader object.
 
Methods inherited from class javax.media.ding3d.Shader
getShaderType, getShadingLanguage
 
Methods inherited from class javax.media.ding3d.NodeComponent
cloneNodeComponent, duplicateNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree
 
Methods inherited from class javax.media.ding3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SourceCodeShader

public SourceCodeShader(int shadingLanguage,
                        int shaderType,
                        java.lang.String shaderSource)
Constructs a new shader object of the specified shading language and shader type from the specified source string.

Parameters:
shadingLanguage - the specified shading language, one of: SHADING_LANGUAGE_GLSL or SHADING_LANGUAGE_CG.
shaderType - the shader type, one of: SHADER_TYPE_VERTEX or SHADER_TYPE_FRAGMENT.
shaderSource - the shader source code
Throws:
java.lang.NullPointerException - if shaderSource is null.
Method Detail

getShaderSource

public java.lang.String getShaderSource()
Retrieves the shader source string from this shader object.

Returns:
the shader source string.

cloneNodeComponent

public NodeComponent cloneNodeComponent()
Deprecated. replaced with cloneNodeComponent(boolean forceDuplicate)

Overrides:
cloneNodeComponent in class NodeComponent