Package com.jme3.shader
Class ShaderNodeVariable
java.lang.Object
com.jme3.shader.ShaderNodeVariable
A shader node variable
-
Constructor Summary
ConstructorsConstructorDescriptionShaderNodeVariable(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 Summary
Modifier 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
-
ShaderNodeVariable
creates a ShaderNodeVariable- Parameters:
type- the glsl type of the variablename- the name of the variable
-
ShaderNodeVariable
creates a ShaderNodeVariable- Parameters:
type- the glsl type of the variablenameSpace- the nameSpace (can be the name of the shaderNode or Global,Attr,MatParam,WorldParam)name- the name of the variablemultiplicity- the number of element if this variable is an array. Can be an Int of a declared material parameter
-
ShaderNodeVariable
public ShaderNodeVariable(String type, String nameSpace, String name, String multiplicity, String prefix) creates a ShaderNodeVariable- Parameters:
type- the glsl type of the variablenameSpace- the nameSpace (can be the name of the shaderNode or Global,Attr,MatParam,WorldParam)name- the name of the variablemultiplicity- the number of element if this variable is an array. Can be an Int of a declared material parameterprefix- the variable prefix to append at generation times. This is mostly to add the g_ and m_ for uniforms
-
ShaderNodeVariable
creates a ShaderNodeVariable- Parameters:
type- the glsl type of the variablenameSpace- the nameSpace (can be the name of the shaderNode or Global,Attr,MatParam,WorldParam)name- the name of the variable
-
-
Method Details
-
getName
returns the name- Returns:
- the name
-
setName
sets the name- Parameters:
name- the name
-
getType
- Returns:
- the glsl type
-
setType
sets 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
-
setPrefix
Sets the variable prefix (m_ or g_)- Parameters:
prefix- the desired prefix
-
setNameSpace
sets the nameSpace (can be the name of the shaderNode or Global,Attr,MatParam,WorldParam)- Parameters:
nameSpace- the desired nameSpace
-
getDefaultValue
Gets the default value of this variable.- Returns:
- the default value of this variable.
-
setDefaultValue
Sets the default value of this variable.- Parameters:
defaultValue- the default value of this variable.
-
hashCode
public int hashCode() -
equals
-
write
jme serialization (not used)- Specified by:
writein interfaceSavable- Parameters:
ex- the exporter- Throws:
IOException- from the exporter
-
read
jme serialization (not used)- Specified by:
readin interfaceSavable- Parameters:
im- the importer- Throws:
IOException- from the importer
-
getCondition
- Returns:
- the condition for this variable to be declared
-
setCondition
sets the condition- Parameters:
condition- the condition
-
toString
-
isShaderOutput
public boolean isShaderOutput()- Returns:
- true if this variable is a shader output
-
setShaderOutput
public 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
-
setMultiplicity
sets 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 classObject- Throws:
CloneNotSupportedException
-