Class SourceCodeShader
java.lang.Object
javax.media.j3d.SceneGraphObject
javax.media.j3d.NodeComponent
javax.media.j3d.Shader
javax.media.j3d.SourceCodeShader
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:
-
Field Summary
Fields inherited from class Shader
SHADER_TYPE_FRAGMENT, SHADER_TYPE_VERTEX, SHADING_LANGUAGE_CG, SHADING_LANGUAGE_GLSL -
Constructor Summary
ConstructorsConstructorDescriptionSourceCodeShader(int shadingLanguage, int shaderType, String shaderSource) Constructs a new shader object of the specified shading language and shader type from the specified source string. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.replaced with cloneNodeComponent(boolean forceDuplicate)Retrieves the shader source string from this shader object.Methods inherited from class Shader
getShaderType, getShadingLanguageMethods inherited from class NodeComponent
cloneNodeComponent, duplicateNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree
-
Constructor Details
-
SourceCodeShader
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_GLSLorSHADING_LANGUAGE_CG.shaderType- the shader type, one of:SHADER_TYPE_VERTEXorSHADER_TYPE_FRAGMENT.shaderSource- the shader source code- Throws:
NullPointerException- if shaderSource is null.
-
-
Method Details
-
getShaderSource
Retrieves the shader source string from this shader object.- Returns:
- the shader source string.
-
cloneNodeComponent
Deprecated.replaced with cloneNodeComponent(boolean forceDuplicate)- Overrides:
cloneNodeComponentin classNodeComponent
-