Package com.jme3.material
Class MaterialDef
java.lang.Object
com.jme3.material.MaterialDef
Describes a J3MD (Material definition).
-
Constructor Summary
ModifierConstructorDescriptionprotected
Serialization only.MaterialDef
(AssetManager assetManager, String name) Creates a new material definition with the given name. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMaterialParam
(VarType type, String name, Object value) Adds a new material parameter.void
addMaterialParamTexture
(VarType type, String name, ColorSpace colorSpace, Texture value) Adds a new material parameter.void
addTechniqueDef
(TechniqueDef technique) Adds a new technique definition to this material definition.Returns the AssetManager passed in the constructor.Returns the asset key name of the asset from which this material definition was loaded.getMaterialParam
(String name) Returns the material parameter with the given name.Returns a collection of all material parameters declared in this material definition.getName()
The debug name of the material definition.getTechniqueDefs
(String name) Returns technique definitions with the given name.void
setAssetName
(String assetName) Set the asset key name.
-
Constructor Details
-
MaterialDef
protected MaterialDef()Serialization only. Do not use. -
MaterialDef
Creates a new material definition with the given name.- Parameters:
assetManager
- The asset manager to use to load shadersname
- The debug name of the material definition
-
-
Method Details
-
getAssetName
Returns the asset key name of the asset from which this material definition was loaded.- Returns:
- Asset key name of the j3md file
-
setAssetName
Set the asset key name.- Parameters:
assetName
- the asset key name
-
getAssetManager
Returns the AssetManager passed in the constructor.- Returns:
- the AssetManager passed in the constructor.
-
getName
The debug name of the material definition.- Returns:
- debug name of the material definition.
-
addMaterialParam
Adds a new material parameter.- Parameters:
type
- Type of the parametername
- Name of the parametervalue
- Default value of the parameter
-
addMaterialParamTexture
public void addMaterialParamTexture(VarType type, String name, ColorSpace colorSpace, Texture value) Adds a new material parameter.- Parameters:
type
- Type of the parametername
- Name of the parametercolorSpace
- the color space of the texture required by this texture paramvalue
- Default value of the parameter- See Also:
-
getMaterialParam
Returns the material parameter with the given name.- Parameters:
name
- The name of the parameter to retrieve- Returns:
- The material parameter, or null if it does not exist.
-
getMaterialParams
Returns a collection of all material parameters declared in this material definition.Modifying the material parameters or the collection will lead to undefined results.
- Returns:
- All material parameters declared in this definition.
-
addTechniqueDef
Adds a new technique definition to this material definition.- Parameters:
technique
- The technique definition to add.
-
getTechniqueDefs
Returns technique definitions with the given name.- Parameters:
name
- The name of the technique definitions to find- Returns:
- The technique definitions, or null if cannot be found.
-
getTechniqueDefsNames
- Returns:
- the list of all the technique definitions names.
-