Modifier and Type | Class and Description |
---|---|
static class |
TechniqueDef.LightMode
Describes light rendering mode.
|
static class |
TechniqueDef.LightSpace
Define in what space the light data should be sent to the shader.
|
static class |
TechniqueDef.ShadowMode |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_TECHNIQUE_NAME
The default technique name.
|
static int |
SAVABLE_VERSION
Version #1: Separate shader language for each shader source.
|
Modifier | Constructor and Description |
---|---|
protected |
TechniqueDef()
Serialization only.
|
|
TechniqueDef(java.lang.String name,
int sortId)
Creates a new technique definition.
|
Modifier and Type | Method and Description |
---|---|
void |
addShaderParamDefine(java.lang.String paramName,
VarType paramType,
java.lang.String defineName)
Adds a define linked to a material parameter.
|
int |
addShaderUnmappedDefine(java.lang.String defineName,
VarType defineType)
Add an unmapped define which can only be set by define ID.
|
boolean |
addWorldParam(java.lang.String name)
Adds a new world parameter by the given name.
|
TechniqueDef |
clone() |
DefineList |
createDefineList()
Create a define list with the size matching the number
of defines on this technique.
|
VarType |
getDefineIdType(int defineId)
Get the type of a particular define.
|
java.lang.String[] |
getDefineNames()
Get the names of all defines declared on this technique definition.
|
VarType[] |
getDefineTypes()
Get the types of all defines declared on this technique definition.
|
RenderState |
getForcedRenderState() |
java.lang.String |
getFragmentShaderLanguage()
Returns the language of the fragment shader used in this technique.
|
java.lang.String |
getFragmentShaderName()
Returns the name of the fragment shader used by the technique, or null
if no fragment shader is specified.
|
TechniqueDef.LightMode |
getLightMode()
Returns the light mode.
|
TechniqueDef.LightSpace |
getLightSpace()
Returns the space in which the light data should be passed to the shader.
|
TechniqueDefLogic |
getLogic() |
java.lang.String |
getName()
Returns the name of this technique as specified in the J3MD file.
|
RenderState |
getRenderState()
Returns the render state that this technique is using
|
java.util.EnumSet<Caps> |
getRequiredCaps()
Gets the
renderer capabilities that are required
by this technique. |
Shader |
getShader(AssetManager assetManager,
java.util.EnumSet<Caps> rendererCaps,
DefineList defines) |
ShaderGenerationInfo |
getShaderGenerationInfo() |
java.util.List<ShaderNode> |
getShaderNodes() |
java.lang.String |
getShaderParamDefine(java.lang.String paramName)
Returns the define name which the given material parameter influences.
|
java.lang.Integer |
getShaderParamDefineId(java.lang.String paramName)
Get the define ID for a given material parameter.
|
java.lang.String |
getShaderProgramLanguage(Shader.ShaderType shaderType)
Returns the language for each shader program
|
java.util.EnumMap<Shader.ShaderType,java.lang.String> |
getShaderProgramLanguages()
Returns the Enum containing the ShaderProgramLanguages;
|
java.lang.String |
getShaderProgramName(Shader.ShaderType shaderType)
Returns the name for each shader program
|
java.util.EnumMap<Shader.ShaderType,java.lang.String> |
getShaderProgramNames()
Returns the Enum containing the ShaderProgramNames;
|
java.lang.String |
getShaderPrologue() |
TechniqueDef.ShadowMode |
getShadowMode()
Returns the shadow mode.
|
int |
getSortId() |
java.lang.String |
getVertexShaderLanguage()
Returns the language of the vertex shader used in this technique.
|
java.lang.String |
getVertexShaderName()
Returns the name of the vertex shader used by the technique, or null
if no vertex shader is specified.
|
float |
getWeight()
returns the weight of the technique def
|
java.util.List<UniformBinding> |
getWorldBindings()
Returns a list of world parameters that are used by this
technique definition.
|
boolean |
isNoRender()
Returns true if this technique should not be used to render.
|
boolean |
isUsingShaderNodes()
Returns true if this technique uses Shader Nodes, false otherwise.
|
void |
read(JmeImporter im) |
void |
setForcedRenderState(RenderState forcedRenderState) |
void |
setLightMode(TechniqueDef.LightMode lightMode)
Set the light mode
|
void |
setLightSpace(TechniqueDef.LightSpace lightSpace)
Sets the space in which the light data should be passed to the shader.
|
void |
setLogic(TechniqueDefLogic logic) |
void |
setNoRender(boolean noRender)
Sets if this technique should not be used to render.
|
void |
setRenderState(RenderState renderState)
Sets the render state that this technique is using.
|
void |
setShaderFile(java.util.EnumMap<Shader.ShaderType,java.lang.String> shaderNames,
java.util.EnumMap<Shader.ShaderType,java.lang.String> shaderLanguages)
Sets the shaders that this technique definition will use.
|
void |
setShaderFile(java.lang.String vertexShader,
java.lang.String fragmentShader,
java.lang.String vertLanguage,
java.lang.String fragLanguage)
Sets the shaders that this technique definition will use.
|
void |
setShaderGenerationInfo(ShaderGenerationInfo shaderGenerationInfo) |
void |
setShaderNodes(java.util.List<ShaderNode> shaderNodes) |
void |
setShaderPrologue(java.lang.String shaderPrologue)
Set a string which is prepended to every shader used by this technique.
|
void |
setShadowMode(TechniqueDef.ShadowMode shadowMode)
Set the shadow mode.
|
java.lang.String |
toString() |
void |
write(JmeExporter ex) |
public static final int SAVABLE_VERSION
public static final java.lang.String DEFAULT_TECHNIQUE_NAME
public TechniqueDef(java.lang.String name, int sortId)
Used internally by the J3M/J3MD loader.
name
- The name of the techniqueprotected TechniqueDef()
public int getSortId()
public java.lang.String getName()
DEFAULT_TECHNIQUE_NAME
.public TechniqueDef.LightMode getLightMode()
TechniqueDef.LightMode
public void setLightMode(TechniqueDef.LightMode lightMode)
lightMode
- the light modeTechniqueDef.LightMode
public void setLogic(TechniqueDefLogic logic)
public TechniqueDefLogic getLogic()
public TechniqueDef.ShadowMode getShadowMode()
public void setShadowMode(TechniqueDef.ShadowMode shadowMode)
shadowMode
- the shadow mode.TechniqueDef.ShadowMode
public RenderState getRenderState()
setRenderState(com.jme3.material.RenderState)
public void setRenderState(RenderState renderState)
renderState
- the render state that this technique is using.RenderState
public void setNoRender(boolean noRender)
noRender
- not render or render ?isNoRender()
public boolean isNoRender()
public boolean isUsingShaderNodes()
public java.util.EnumSet<Caps> getRequiredCaps()
renderer capabilities
that are required
by this technique.public void setShaderFile(java.lang.String vertexShader, java.lang.String fragmentShader, java.lang.String vertLanguage, java.lang.String fragLanguage)
vertexShader
- The name of the vertex shaderfragmentShader
- The name of the fragment shadervertLanguage
- The vertex shader languagefragLanguage
- The fragment shader languagepublic void setShaderPrologue(java.lang.String shaderPrologue)
shaderPrologue
- The prologue to append before the technique's shaders.public java.lang.String getShaderPrologue()
public java.lang.String getShaderParamDefine(java.lang.String paramName)
paramName
- The parameter name to look upaddShaderParamDefine(java.lang.String, com.jme3.shader.VarType, java.lang.String)
public java.lang.Integer getShaderParamDefineId(java.lang.String paramName)
paramName
- The parameter name to look uppublic VarType getDefineIdType(int defineId)
defineId
- The define ID to lookup.public void addShaderParamDefine(java.lang.String paramName, VarType paramType, java.lang.String defineName)
Any time the material parameter on the parent material is altered,
the appropriate define on the technique will be modified as well.
When set, the material parameter will be mapped to an integer define,
typically 1
if it is set, unless it is an integer or a float,
in which case it will converted into an integer.
paramName
- The name of the material parameter to link to.paramType
- The type of the material parameter to link to.defineName
- The name of the define parameter, e.g. USE_LIGHTINGpublic int addShaderUnmappedDefine(java.lang.String defineName, VarType defineType)
defineName
- The define name to createpublic java.lang.String[] getDefineNames()
public VarType[] getDefineTypes()
public DefineList createDefineList()
public Shader getShader(AssetManager assetManager, java.util.EnumSet<Caps> rendererCaps, DefineList defines)
public void setShaderFile(java.util.EnumMap<Shader.ShaderType,java.lang.String> shaderNames, java.util.EnumMap<Shader.ShaderType,java.lang.String> shaderLanguages)
shaderNames
- EnumMap containing all shader names for this stageshaderLanguages
- EnumMap containing all shader languages for this stagepublic java.lang.String getFragmentShaderName()
public java.lang.String getVertexShaderName()
public java.lang.String getFragmentShaderLanguage()
public java.lang.String getVertexShaderLanguage()
public java.lang.String getShaderProgramLanguage(Shader.ShaderType shaderType)
shaderType
- public java.lang.String getShaderProgramName(Shader.ShaderType shaderType)
shaderType
- public float getWeight()
public boolean addWorldParam(java.lang.String name)
name
- The world parameter to add.public RenderState getForcedRenderState()
public void setForcedRenderState(RenderState forcedRenderState)
public java.util.List<UniformBinding> getWorldBindings()
public void write(JmeExporter ex) throws java.io.IOException
public void read(JmeImporter im) throws java.io.IOException
public java.util.List<ShaderNode> getShaderNodes()
public void setShaderNodes(java.util.List<ShaderNode> shaderNodes)
public java.util.EnumMap<Shader.ShaderType,java.lang.String> getShaderProgramNames()
public java.util.EnumMap<Shader.ShaderType,java.lang.String> getShaderProgramLanguages()
public ShaderGenerationInfo getShaderGenerationInfo()
public void setShaderGenerationInfo(ShaderGenerationInfo shaderGenerationInfo)
public java.lang.String toString()
toString
in class java.lang.Object
public TechniqueDef.LightSpace getLightSpace()
public void setLightSpace(TechniqueDef.LightSpace lightSpace)
lightSpace
- the light spacepublic TechniqueDef clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException