Class GltfScene.MaterialInfo
java.lang.Object
com.codename1.gpu.GltfScene.MaterialInfo
- Enclosing class:
GltfScene
The parts of a glTF material a
Material can express.-
Method Summary
Modifier and TypeMethodDescriptionvoidapplyMaps(GltfScene scene, GraphicsDevice device, Material material) Applies every map of this material thatscenecould decode tomaterial: normal, occlusion, emissive and metallic-roughness.intThe base color factor as ARGB.intThe emissive factor as an opaque ARGB colour, black for none.intThe index of the emissive image, or -1.intgetImage()The index of the base color image, or -1.floatThe metallic factor, from 0 to 1; glTF's default is 1.intThe index of the metallic-roughness image, or -1.getName()The material's name, or an empty string.intThe index of the normal map image, or -1.floatThe normal map's scale; glTF's default is 1.intThe index of the occlusion image, or -1.floatThe occlusion strength; glTF's default is 1.floatThe roughness factor, from 0 to 1; glTF's default is 1.booleanisBlend()True when the material's alpha mode isBLEND.booleanTrue when back faces must not be culled.
-
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
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
Applies every map of this material that
scenecould decode tomaterial: normal, occlusion, emissive and metallic-roughness.Parameters
-
scene: the scene this material came from -
device: the device to upload the images to -
material: 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 isBLEND.
-