Package com.jme3.material
Class MatParamTexture
java.lang.Object
com.jme3.material.MatParam
com.jme3.material.MatParamTexture
A material parameter that holds a reference to a texture and its required color space.
This class extends
MatParam
to provide texture specific functionalities.-
Field Summary
-
Constructor Summary
ConstructorDescriptionSerialization only.MatParamTexture
(VarType type, String name, Texture texture, ColorSpace colorSpace) Constructs a new MatParamTexture instance with the specified type, name, texture, and color space. -
Method Summary
Modifier and TypeMethodDescriptionGets the required color space for this texture parameter.Retrieves the texture associated with this material parameter.void
read
(JmeImporter im) void
setColorSpace
(ColorSpace colorSpace) Set toColorSpace.Linear
if the texture color space has to be forced to linear instead of sRGB.void
setTextureValue
(Texture value) Sets the texture associated with this material parameter.void
write
(JmeExporter ex) Methods inherited from class com.jme3.material.MatParam
clone, equals, getName, getPrefixedName, getValue, getValueAsString, getVarType, hashCode, isTypeCheckEnabled, setTypeCheckEnabled, setValue, toString
-
Constructor Details
-
MatParamTexture
Constructs a new MatParamTexture instance with the specified type, name, texture, and color space.- Parameters:
type
- the type of the material parametername
- the name of the parametertexture
- the texture associated with this parametercolorSpace
- the required color space for the texture
-
MatParamTexture
public MatParamTexture()Serialization only. Do not use.
-
-
Method Details
-
getTextureValue
Retrieves the texture associated with this material parameter.- Returns:
- the texture object
-
setTextureValue
Sets the texture associated with this material parameter.- Parameters:
value
- the texture object to set- Throws:
RuntimeException
- if the provided value is not aTexture
-
getColorSpace
Gets the required color space for this texture parameter.- Returns:
- the required color space (
ColorSpace
)
-
setColorSpace
Set toColorSpace.Linear
if the texture color space has to be forced to linear instead of sRGB.- Parameters:
colorSpace
- the desired color space
-
write
- Specified by:
write
in interfaceSavable
- Overrides:
write
in classMatParam
- Throws:
IOException
-
read
- Specified by:
read
in interfaceSavable
- Overrides:
read
in classMatParam
- Throws:
IOException
-