Skip to content

MaterialXLoader: Can't load standard_surface_brick_procedural.mtlx sample file #28988

Closed
@hybridherbst

Description

Description

When loading the attached sample file (and textures) with MaterialXLoader, a shader error is thrown:

WebGPU:
image

WebGL:
image

(Side note, I find it confusing that shader errors are now logged as warnings on WebGPURenderer, despite them still fully stopping the render loop.)

Reproduction steps

  1. Go to https://academysoftwarefoundation.github.io/MaterialX/
  2. In the top left dropdown, select "standard_surface_brick_procedural.mtlx"
  3. Play with the parameters on the right side
  4. Download the files (standard_surface_brick_procedural.zip)
  5. Load with MaterialXLoader
  6. Note the exception.

Code

    // MaterialX
    const mtlxLoader = new MaterialXLoader();
    const path = "https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/resources/Materials/Examples/StandardSurface/";
    const file = "standard_surface_brick_procedural.mtlx";
    mtlxLoader
          .setPath( path )
	  .loadAsync( file )
          .then( ({ materials}) => { 
          	console.log("Loaded materials", materials);
                 const firstMaterial = Object.values( materials )[0];
                 mesh.material = firstMaterial;

                 // should be able to adjust procedural parameters here
          });

Live example

https://jsfiddle.net/w6uqog3n/16/

Screenshots

image

Version

r167

Device

No response

Browser

No response

OS

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions