Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public static final class GltfScene.MaterialInfo
- Object
- GltfScene.MaterialInfo
The parts of a glTF material a
Material can express.Methods
public float getMetallic() | The metallic factor, from 0 to 1; glTF’s default is 1. |
public float getRoughness() | The roughness factor, from 0 to 1; glTF’s default is 1. |
public int getEmissive() | The emissive factor as an opaque ARGB colour, black for none. |
public String getName() | The material’s name, or an empty string. |
public int getBaseColor() | The base color factor as ARGB. |
public int getImage() | The index of the base color image, or -1. |
public int getNormalImage() | The index of the normal map image, or -1. |
public float getNormalScale() | The normal map’s scale; glTF’s default is 1. |
public int getOcclusionImage() | The index of the occlusion image, or -1. |
public float getOcclusionStrength() | The occlusion strength; glTF’s default is 1. |
public int getEmissiveImage() | The index of the emissive image, or -1. |
public int getMetallicRoughnessImage() | The index of the metallic-roughness image, or -1. |
public void applyMaps(GltfScene scene, GraphicsDevice device, Material material) | Applies every map of this material that scene could decode to material: normal, occlusion, emissive and metallic-roughness. |
public boolean isDoubleSided() | True when back faces must not be culled. |
public boolean isBlend() | True when the material’s alpha mode is BLEND. |
Inherited methods
Method details
getMetallic
public float getMetallic()The metallic factor, from 0 to 1; glTF’s default is 1.
getRoughness
public float getRoughness()The roughness factor, from 0 to 1; glTF’s default is 1.
getEmissive
public int getEmissive()The emissive factor as an opaque ARGB colour, black for none.
getName
public String getName()The material’s name, or an empty string.
getBaseColor
public int getBaseColor()The base color factor as ARGB.
getImage
public int getImage()The index of the base color image, or -1.
getNormalImage
public int getNormalImage()The index of the normal map image, or -1.
getNormalScale
public float getNormalScale()The normal map’s scale; glTF’s default is 1.
getOcclusionImage
public int getOcclusionImage()The index of the occlusion image, or -1.
getOcclusionStrength
public float getOcclusionStrength()The occlusion strength; glTF’s default is 1.
getEmissiveImage
public int getEmissiveImage()The index of the emissive image, or -1.
getMetallicRoughnessImage
public int getMetallicRoughnessImage()The index of the metallic-roughness image, or -1.
applyMaps
public void applyMaps(GltfScene scene, GraphicsDevice device, Material material)Applies every map of this material that
scene could decode to
material: normal, occlusion, emissive and metallic-roughness.Parameters
sceneGltfScene- the scene this material came from
deviceGraphicsDevice- the device to upload the images to
materialMaterial- the material to configure
isDoubleSided
public boolean isDoubleSided()True when back faces must not be culled.
isBlend
public boolean isBlend()True when the material’s alpha mode is
BLEND.