playcanvas / engine

Powerful web graphics runtime built on WebGL, WebGPU, WebXR and glTF
https://playcanvas.com
MIT License
9.73k stars 1.36k forks source link

Investigate integration of Material X #5471

Open mvaligursky opened 1 year ago

mvaligursky commented 1 year ago

MaterialX is an open standard for representing rich material and look-development content in computer graphics, enabling its platform-independent description and exchange across applications and renderers.

https://materialx.org/

There is a shader generation for it: https://materialx.org/Tools.html#ShaderGen

Also, Autodesk has a wasm shader generator that is framework agnostic and could work with any WebGL engine

Screenshot 2023-07-11 at 18 33 37
Maksims commented 1 year ago

I've researched a bit the node-based shaders, and their availability across the web 3D. And currently MaterialX - looks like the closest and most popular to be available.

But I do have few questions of its suitability and use:

  1. Currently MaterialX supports human readable format (XML-like), does it have a binary, format which is transferable?
  2. Editors - what the availability and majorly adopted editing tools for the graphs? Do they provide easy tools for debugging, previewing, and project managing them?
  3. Does PlayCanvas Editor should provide editing tools for MaterialX formats?
  4. How well it allows to tap into shader generation process to integrate well into engine shader back-ends? So it has first party integration with lighting system, and other bits.
  5. How flexible and extensible MaterialX, does it provide tools for creativity, or it provides templates that are set in stone and will limit amount of creativity by tech-artists?
  6. How well supported it is across other authoring tools: Blender, Maya, AutoCAD, etc?
issacclee commented 1 month ago

https://github.com/KhronosGroup/glTF/tree/KHR_texture_procedurals/extensions/2.0/Khronos/KHR_texture_procedurals

There's an initial draft proposed in the main glTF repo. When it get ratified, maybe we can support MaterialX through implementing loader logic for this extension.