Class GltfMaterialData
java.lang.Object
com.jme3.scene.plugins.gltf.GltfMaterialData
Stores all data of a single material from a GLTF file.
This data can then be used by a
GltfMaterialFactory to create a new material.
Parameter naming convention
- Parameter names should use single dots '.' as a separator.
- All standard parameter names are directly taken from the GLTF specs document (ยง 5.19. Material and following).
-
All additional parameter names from GLTF extensions should start with
MATERIAL_EXTENSION_PARAM_PREFIXfollowed by the name of the extension (e.g. "KHR_materials_unlit") and finished by the parameter name. -
All additional parameter names from GLTF extras should start with
MATERIAL_EXTRA_PARAM_PREFIX.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGltfExtension(String gltfExtension) Adds the given GLTF extension name.booleancontainsGltfParam(String gltfParamName) Checks if the material provides a material parameter with the given name.getGltfParam(String gltfParamName) Gets the material parameter with the given name.booleanhasGltfExtension(String gltfExtension) Checks if the material provides the given GLTF extension.booleanvoidremoveGltfExtension(String gltfExtension) Removes the given GLTF extension name.removeGltfParam(String gltfParamName) Removes the material parameter with the given name.voidsetGltfParam(String gltfParamName, Object value) Adds a material parameter with the given name and value.voidsetHasVertexColors(boolean hasVertexColors) Sets the vertex color flag.
-
Field Details
-
MATERIAL_NAME_PARAM
- See Also:
-
BASE_COLOR_PARAM
- See Also:
-
BASE_COLOR_TEXTURE_PARAM
- See Also:
-
METALLIC_FACTOR_PARAM
- See Also:
-
ROUGHNESS_FACTOR_PARAM
- See Also:
-
METALLIC_ROUGHNESS_TEXTURE_PARAM
- See Also:
-
NORMAL_TEXTURE_PARAM
- See Also:
-
NORMAL_SCALE_PARAM
- See Also:
-
OCCLUSION_TEXTURE_PARAM
- See Also:
-
OCCLUSION_TEXTURE_STRENGTH_PARAM
- See Also:
-
EMISSIVE_TEXTURE_PARAM
- See Also:
-
EMISSIVE_COLOR_PARAM
- See Also:
-
ALPHA_MODE_PARAM
- See Also:
-
ALPHA_CUTOFF_PARAM
- See Also:
-
DOUBLE_SIDED_PARAM
- See Also:
-
MATERIAL_EXTENSION_PARAM_PREFIX
- See Also:
-
MATERIAL_EXTRA_PARAM_PREFIX
- See Also:
-
-
Constructor Details
-
GltfMaterialData
public GltfMaterialData()
-
-
Method Details
-
hasGltfExtension
Checks if the material provides the given GLTF extension.- Parameters:
gltfExtension- The GLTF extension name.- Returns:
- true if the material provides the given GLTF extension, otherwise false.
-
addGltfExtension
Adds the given GLTF extension name.- Parameters:
gltfExtension- The GLTF extension name.
-
removeGltfExtension
Removes the given GLTF extension name.- Parameters:
gltfExtension- The GLTF extension name.
-
containsGltfParam
Checks if the material provides a material parameter with the given name.- Parameters:
gltfParamName- The GLTF parameter name.- Returns:
- true if the material provides a material parameter with the given name, otherwise false.
-
getGltfParam
-
setGltfParam
-
removeGltfParam
-
hasVertexColors
public boolean hasVertexColors()- Returns:
- Indicates the existence of a vertex color buffer.
-
setHasVertexColors
public void setHasVertexColors(boolean hasVertexColors) Sets the vertex color flag.- Parameters:
hasVertexColors- The value to set.
-