SDK · crate
kinogaki-mtlx
MaterialX 1.39 for Kinogaki Studio: the material layer every engine, format and core share, in our own implementation (MaterialX's C++ library is a reference and a test oracle, never a dependency).
- Repository
- SDK (kinogaki/studio-sdk)
- Folder
sdk/crates/mtlx- Source
- 16 files, 4,597 lines
- Tests
- 2 files, 476 lines
What it is
MaterialX 1.39 for Kinogaki Studio: the material layer every engine, format and core share, in our own implementation (MaterialX's C++ library is a reference and a test oracle, never a dependency).
- Documents (
Document): read from their XML and written back as MaterialX writes them, comments and blank lines kept; MaterialX 1.36 to 1.38 documents are upgraded to 1.39 as they are read, as MaterialX's own reader does. - The library (
library): MaterialX 1.39.5's definition files (stdlib, pbrlib, the shading models in bxdf with their translation graphs, cmlib, nprlib, lights), vendored verbatim as data with their Apache-2.0 licence (libraries/), and Kinogaki's own definitions (kinogaki/), embedded and read once a process. - Definitions (
NodeDef): one typed signature of a node each, their inputs (Port) with MaterialX's defaults, UI hints, uniform and enumeration meaning, and the geometric properties (GeomProp) unconnected inputs read. - Expansion (
Graph,Library::implementation): a node a graph defines, as that graph, resolved once per definition. - Translation (
Library::translation): the chain of<from>_to_<to>definitions from one shading model to another. - Evaluation (
NodeDef::evaluate): a node of constants as its value. - Materials (
Material): a document's materials as flat networks, its graphs and its own graph-defined nodes inlined (Document::materials), its includes read first (Document::include); and a document written of materials (Document::of_materials), Kinogaki's definitions they use with them.
The crate depends on the standard library alone.
Depends on
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-geometry | SDK | normal | Kinogaki Studio's standard geometry values. |
Third-party
None.
Used by
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-core-package | Core and the app | normal | Core's own SDK package (kinogaki.core): what Studio holds whatever plugins are installed. |
kinogaki-fbx | FBX | normal | FBX as a read-only format plugin for Kinogaki Studio. |
kinogaki-materialx | MaterialX | tests | MaterialX documents (.mtlx), a format plugin: a document's materials read as Studio's Materials, MaterialX networks of nodes, and Materials written as one. |
kinogaki-render-api | SDK | normal | Kinogaki's render interface: what a host (Studio) sends a render engine and what comes back, with no GPU or OS API. |
kinogaki-usd | USD | normal | Universal Scene Description as a format plugin for Kinogaki Studio: usda, usdc and usdz files read into the standard values and written from them. |
Modules
document(private)Document: a MaterialX document, read from its XML (FromStr, upgrading MaterialX 1.36–1.38 to 1.39 as MaterialX's own reader does) and written back (Display) as MaterialX writes one.160 lineseval(private)Evaluating a node whose inputs all hold values: MaterialX's own formulas (its GLSL implementations') for stdlib's arithmetic, channel, conditional and adjustment leaves and pbrlib'sroughness_anisotropy(what the translations between shading models compute ...496 linesgraph(private)Graph: a definition's graph implementation, resolved and checked: each node's definition found as MaterialX finds it, each input bound to a value, another node's output or the definition's own input of the same type, and each of the definition's outputs ...155 lineslibrary(private)Library: node definitions, the graphs implementing them and the geometric properties their inputs default to, read once from MaterialX documents (library: MaterialX 1.39.5's libraries and Kinogaki's).636 linesmaterial(private)A document's materials, each as a flat network (Material): what a file format reads of a MaterialX document (Document::materials) and writes one of (Document::of_materials).123 linesmaterial::read(private)A document's materials, flattened (the module docs say how).493 linesmaterial::write(private)A document made of materials (the module docs say how).232 linestranslate(private)Translations between shading models: the definitions of nodes named<from>_to_<to>in grouptranslation(MaterialX'sstandard_surface_to_open_pbr_surface, Kinogaki'sgltf_pbr_to_open_pbr_surface), chained by a breadth-first search, as MaterialX's ...98 linestypes(private)MaterialX's types (Type) and the values of the ones that hold numbers, flags and text (Value), read from and written as MaterialX's attribute text ("0.8, 0.8, 0.8").205 linesupgrade(private)Documents of MaterialX 1.36 to 1.38 upgraded to 1.39, step by step, as MaterialX'sDocument::upgradeVersionupgrades them with no library loaded: renamed nodes and inputs,color2asvector2, material elements as material nodes, BSDF layering aslayer...47 linesupgrade::tree(private)A document as an arena of elements, for upgrading: stable ids, parents, and the graph questions MaterialX's upgrade asks (a port's node, a node's downstream ports, a free child name), answered as its ownElementclasses answer them.388 linesupgrade::v137(private)The upgrades from 1.36 to 1.37 and from 1.37 to 1.38.437 linesupgrade::v139(private)The upgrade from 1.38 to 1.39:channelsattributes andswizzlenodes asconstant,extract,convert,combineandseparatenodes; thin-film layers as inputs of the BSDFs below them; subsurface radii as colors; switches of ten inputs;atan2's ...421 linesxml(private)The XML MaterialX documents are written in, read and written as MaterialX's own reader and writer do (pugixml with MaterialX's comment and newline options): elements and their attributes in order, comments kept verbatim, and each blank line between elements ...445 lines
Public types and traits
At the crate root
Structs DocumentGeomPropGraphGraphNodeIncludedLibraryMaterialMaterialNodeNodeDefPort
Enums BindingBoundTypeValue
By module: 14 public types and traits in 5 modules
document DocumentIncluded
graph BindingGraphGraphNode
library GeomPropLibraryNodeDefPort
material BoundMaterialMaterialNode
types TypeValue
