Package com.jme3.shader
Class ShaderNodeVariable
java.lang.Object
com.jme3.shader.ShaderNodeVariable
A shader node variable
- 
Constructor SummaryConstructorsConstructorDescriptionShaderNodeVariable(String type, String name) creates a ShaderNodeVariableShaderNodeVariable(String type, String nameSpace, String name) creates a ShaderNodeVariableShaderNodeVariable(String type, String nameSpace, String name, String multiplicity) creates a ShaderNodeVariablecreates a ShaderNodeVariable
- 
Method SummaryModifier and TypeMethodDescriptionclone()booleanGets the default value of this variable.getName()returns the namegetType()inthashCode()booleanvoidread(JmeImporter im) jme serialization (not used)voidsetCondition(String condition) sets the conditionvoidsetDefaultValue(String defaultValue) Sets the default value of this variable.voidsetMultiplicity(String multiplicity) sets the number of elements of this variable making it an array this value can be a number of can be a definevoidsets the namevoidsetNameSpace(String nameSpace) sets the nameSpace (can be the name of the shaderNode or Global,Attr,MatParam,WorldParam)voidSets the variable prefix (m_ or g_)voidsetShaderOutput(boolean shaderOutput) sets to true if this variable is a shader outputvoidsets the glsl typetoString()voidwrite(JmeExporter ex) jme serialization (not used)
- 
Constructor Details- 
ShaderNodeVariablecreates a ShaderNodeVariable- Parameters:
- type- the glsl type of the variable
- name- the name of the variable
 
- 
ShaderNodeVariablecreates a ShaderNodeVariable- Parameters:
- type- the glsl type of the variable
- nameSpace- the nameSpace (can be the name of the shaderNode or Global,Attr,MatParam,WorldParam)
- name- the name of the variable
- multiplicity- the number of element if this variable is an array. Can be an Int of a declared material parameter
 
- 
ShaderNodeVariablepublic ShaderNodeVariable(String type, String nameSpace, String name, String multiplicity, String prefix) creates a ShaderNodeVariable- Parameters:
- type- the glsl type of the variable
- nameSpace- the nameSpace (can be the name of the shaderNode or Global,Attr,MatParam,WorldParam)
- name- the name of the variable
- multiplicity- the number of element if this variable is an array. Can be an Int of a declared material parameter
- prefix- the variable prefix to append at generation times. This is mostly to add the g_ and m_ for uniforms
 
- 
ShaderNodeVariablecreates a ShaderNodeVariable- Parameters:
- type- the glsl type of the variable
- nameSpace- the nameSpace (can be the name of the shaderNode or Global,Attr,MatParam,WorldParam)
- name- the name of the variable
 
 
- 
- 
Method Details- 
getNamereturns the name- Returns:
- the name
 
- 
setNamesets the name- Parameters:
- name- the name
 
- 
getType- Returns:
- the glsl type
 
- 
setTypesets the glsl type- Parameters:
- type- the type
 
- 
getNameSpace- Returns:
- the name space (can be the name of the shaderNode or Global,Attr,MatParam,WorldParam)
 
- 
getPrefix- Returns:
- the variable prefix
 
- 
setPrefixSets the variable prefix (m_ or g_)- Parameters:
- prefix- the desired prefix
 
- 
setNameSpacesets the nameSpace (can be the name of the shaderNode or Global,Attr,MatParam,WorldParam)- Parameters:
- nameSpace- the desired nameSpace
 
- 
getDefaultValueGets the default value of this variable.- Returns:
- the default value of this variable.
 
- 
setDefaultValueSets the default value of this variable.- Parameters:
- defaultValue- the default value of this variable.
 
- 
hashCodepublic int hashCode()
- 
equals
- 
writejme serialization (not used)- Specified by:
- writein interface- Savable
- Parameters:
- ex- the exporter
- Throws:
- IOException- from the exporter
 
- 
readjme serialization (not used)- Specified by:
- readin interface- Savable
- Parameters:
- im- the importer
- Throws:
- IOException- from the importer
 
- 
getCondition- Returns:
- the condition for this variable to be declared
 
- 
setConditionsets the condition- Parameters:
- condition- the condition
 
- 
toString
- 
isShaderOutputpublic boolean isShaderOutput()- Returns:
- true if this variable is a shader output
 
- 
setShaderOutputpublic void setShaderOutput(boolean shaderOutput) sets to true if this variable is a shader output- Parameters:
- shaderOutput- true if this variable is a shader output
 
- 
getMultiplicity- Returns:
- the number of elements if this variable is an array
 
- 
setMultiplicitysets the number of elements of this variable making it an array this value can be a number of can be a define- Parameters:
- multiplicity- the desired expression
 
- 
clone- Overrides:
- clonein class- Object
- Throws:
- CloneNotSupportedException
 
 
-