Class MaterialDef

java.lang.Object
com.jme3.material.MaterialDef

public class MaterialDef extends Object
Describes a J3MD (Material definition).
  • Constructor Details

    • MaterialDef

      protected MaterialDef()
      Serialization only. Do not use.
    • MaterialDef

      public MaterialDef(AssetManager assetManager, String name)
      Creates a new material definition with the given name.
      Parameters:
      assetManager - The asset manager to use to load shaders
      name - The debug name of the material definition
  • Method Details

    • getAssetName

      public String 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

      public void setAssetName(String assetName)
      Set the asset key name.
      Parameters:
      assetName - the asset key name
    • getAssetManager

      public AssetManager getAssetManager()
      Returns the AssetManager passed in the constructor.
      Returns:
      the AssetManager passed in the constructor.
    • getName

      public String getName()
      The debug name of the material definition.
      Returns:
      debug name of the material definition.
    • addMaterialParam

      public void addMaterialParam(VarType type, String name, Object value)
      Adds a new material parameter.
      Parameters:
      type - Type of the parameter
      name - Name of the parameter
      value - 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 parameter
      name - Name of the parameter
      colorSpace - the color space of the texture required by this texture param
      value - Default value of the parameter
      See Also:
    • getMaterialParam

      public MatParam getMaterialParam(String name)
      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

      public Collection<MatParam> 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

      public void addTechniqueDef(TechniqueDef technique)
      Adds a new technique definition to this material definition.
      Parameters:
      technique - The technique definition to add.
    • getTechniqueDefs

      public List<TechniqueDef> getTechniqueDefs(String name)
      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

      public Collection<String> getTechniqueDefsNames()
      Returns:
      the list of all the technique definitions names.