Capítulo 186 de 859

Chapter 186: MaterialXLoader

Core Idea

A loader for the MaterialX format.

The node materials loaded with this loader can only be used with WebGPURenderer.

Code Examples

const loader = new MaterialXLoader().setPath( SAMPLE_PATH );
const materials = await loader.loadAsync( 'standard_surface_brass_tiled.mtlx' );
  • What it demonstrates: Typical usage of MaterialXLoader.

Reference Tables

Constructor

Signature
new MaterialXLoader( manager : LoadingManager )

Methods

MethodDescription
.load( url : string, onLoad : function, onProgress : onProgressCallback, onError : onErrorCallback ) : MaterialXLoaderStarts loading from the given URL and passes the loaded MaterialX asset to the onLoad() callback.
.parse( text : string ) : Object.<string, NodeMaterial>Parses the given MaterialX data and returns the resulting materials.

Key Takeaways

  1. MaterialXLoader extends: Loader
  2. Key methods: load, parse.

Connects To