fromType

fun fromType(type: String, uniforms: ERROR CLASS: Symbol not found for JsAny?? = definedExternally): Material(source)

Creates a new material using an existing material type.

Shorthand for: new Material({fabric : {type : type}});

const material = Material.fromType('Color', {
color: new Color(1.0, 0.0, 0.0, 1.0)
});

Return

New material object.

Parameters

type

The base material type.

uniforms

Overrides for the default uniforms.

See also