Search code examples
xcode8scenekitswift4metalkitmetal-performance-shaders

Xcode Model I/O - importing custom shader from Marmoset


Accordion to Apple Model I/o documentation:

Block quote

You can use this framework to import and export assets from and to a variety of industry standard file formats supported by popular authoring tools and game engines.

Block quote

And

Block quote

Describing realistic rendering parameters. TheMDLPhysicallyPlausibleScatteringFunction class—one of many ways to describe the surface appearance for a MDLMaterial object associated with a mesh—defines the intended rendering of a surface using the same physically based shading systems seen in popular feature films and high-end game engines. The MDLPhotometricLight and MDLPhysicallyPlausibleLight classes describe realistic lighting properties for use in rendering, and the MDLCamera class also supports physically based rendering parameters.

Block quote

So,it it possible to import a custom PBR shader created in Marmoset?

If yes, how can I do it?

Thanks


Solution

  • As the documentation (of MDLAsset) also includes:

    “The set of supported formats includes Alembic (.abc), Wavefront Object (.obj), Polygon (.ply), and Standard Tessellation Language (.stl). Additional formats may be supported as well.”

    From marmoset.co: “Marmoset Toolbag uses a somewhat customized shader language, which is a kind of union of HLSL and GLSL syntax conventions”

    Metal uses it’s own shading language and is not even supported by the file formats it can import and export. So in short, no, you can’t import those shaders.