MaterialLoader
class MaterialLoader(val engine: Engine, val context: Context, coroutineScope: CoroutineScope = CoroutineScope(Dispatchers.IO))
A Filament Material defines the visual appearance of an object.
Materials function as a templates from which MaterialInstances can be spawned.
Constructors
Link copied to clipboard
constructor(engine: Engine, context: Context, coroutineScope: CoroutineScope = CoroutineScope(Dispatchers.IO))
Functions
Link copied to clipboard
fun createColorInstance(color: Color, metallic: Float = kMaterialDefaultMetallic, roughness: Float = kMaterialDefaultRoughness, reflectance: Float = kMaterialDefaultReflectance): MaterialInstance
fun createColorInstance(color: Color, metallic: Float = kMaterialDefaultMetallic, roughness: Float = kMaterialDefaultRoughness, reflectance: Float = kMaterialDefaultReflectance): MaterialInstance
fun createColorInstance(color: Int, metallic: Float = kMaterialDefaultMetallic, roughness: Float = kMaterialDefaultRoughness, reflectance: Float = kMaterialDefaultReflectance): MaterialInstance
Creates an opaque or transparent Material depending on the color alpha with the Color passed in.
Link copied to clipboard
fun createImageInstance(imageTexture: Texture, sampler: TextureSampler = TextureSampler2D()): MaterialInstance
Link copied to clipboard
Link copied to clipboard
Creates and returns a Material object.
Creates and returns a Material object from Filamat asset file.
Link copied to clipboard
fun createTextureInstance(texture: Texture, isOpaque: Boolean = true, metallic: Float = kMaterialDefaultMetallic, roughness: Float = kMaterialDefaultRoughness, reflectance: Float = kMaterialDefaultReflectance): MaterialInstance
Creates an an opaque or transparent Material with the Texture passed in.
Link copied to clipboard
fun createUbershaderInstance(config: MaterialProvider.MaterialKey, uvMap: List<MaterialLoader.UvCoordinate> = listOf(
// uv00
UvCoordinate(0, 0),
// uv01
UvCoordinate(0, 1),
// uv11
UvCoordinate(1, 1),
// uv10
UvCoordinate(1, 0)
), label: String? = null, extras: String? = null): MaterialInstance?
Link copied to clipboard
Link copied to clipboard
fun createViewInstance(viewTexture: Texture, unlit: Boolean = false, invertFrontFaceWinding: Boolean = false): MaterialInstance
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun getUbershaderMaterial(config: MaterialProvider.MaterialKey, uvMap: List<MaterialLoader.UvCoordinate> = listOf(
// uv00
UvCoordinate(0, 0),
// uv01
UvCoordinate(0, 1),
// uv11
UvCoordinate(1, 1),
// uv10
UvCoordinate(1, 0)
), label: String? = null): Material?
Link copied to clipboard
Loads a Material from the contents of a Filamat file.
Link copied to clipboard
Loads a Material from the contents of a Filamat file within a created coroutine scope.