Inheritance: Loader →
Class for loading materials. The files are internally loaded via FileLoader.
This loader does not support node materials. Use NodeMaterialLoader instead.
const loader = new THREE.MaterialLoader();
const material = await loader.loadAsync( 'material.json' );
Constructs a new material loader.
manager
The loading manager.
A dictionary holding textures used by the material.
Creates a material for the given type.
type
The material type.
Returns: The new material.
Starts loading from the given URL and pass the loaded material to the onLoad() callback.
url
The path/URL of the file to be loaded. This can also be a data URI.
onLoad
Executed when the loading process has been finished.
onProgress
Executed while the loading is in progress.
onError
Executed when errors occur.
Overrides: Loader#load
Parses the given JSON object and returns a material.
json
The serialized material.
Overrides: Loader#parse
Returns: The parsed material.
Textures are not embedded in the material JSON so they have to be injected before the loading process starts.
value
A dictionary holding textures for material properties.
Returns: A reference to this material loader.
Creates a material for the given type.
type
The material type.
Returns: The new material.