Class MatParamTexture

java.lang.Object
com.jme3.material.MatParam
com.jme3.material.MatParamTexture
All Implemented Interfaces:
Savable, Cloneable

public class MatParamTexture extends MatParam
A material parameter that holds a reference to a texture and its required color space. This class extends MatParam to provide texture specific functionalities.
  • Constructor Details

    • MatParamTexture

      public MatParamTexture(VarType type, String name, Texture texture, ColorSpace colorSpace)
      Constructs a new MatParamTexture instance with the specified type, name, texture, and color space.
      Parameters:
      type - the type of the material parameter
      name - the name of the parameter
      texture - the texture associated with this parameter
      colorSpace - the required color space for the texture
    • MatParamTexture

      public MatParamTexture()
      Serialization only. Do not use.
  • Method Details

    • getTextureValue

      public Texture getTextureValue()
      Retrieves the texture associated with this material parameter.
      Returns:
      the texture object
    • setTextureValue

      public void setTextureValue(Texture value)
      Sets the texture associated with this material parameter.
      Parameters:
      value - the texture object to set
      Throws:
      RuntimeException - if the provided value is not a Texture
    • getColorSpace

      public ColorSpace getColorSpace()
      Gets the required color space for this texture parameter.
      Returns:
      the required color space (ColorSpace)
    • setColorSpace

      public void setColorSpace(ColorSpace colorSpace)
      Set to ColorSpace.Linear if the texture color space has to be forced to linear instead of sRGB.
      Parameters:
      colorSpace - the desired color space
    • write

      public void write(JmeExporter ex) throws IOException
      Specified by:
      write in interface Savable
      Overrides:
      write in class MatParam
      Throws:
      IOException
    • read

      public void read(JmeImporter im) throws IOException
      Specified by:
      read in interface Savable
      Overrides:
      read in class MatParam
      Throws:
      IOException