Skip to content

Commit

Permalink
From gltf conversion (Part 2) (#29)
Browse files Browse the repository at this point in the history
* docs update.

* - Update to use latest 1.39.2 equivalence interface. This should be the final API for the release.
- Add in gltf to mtlx images and mtlx links
- Add in shader translation example
- Update notebook
  • Loading branch information
kwokcb authored Nov 19, 2024
1 parent 2c60899 commit 8ddd4a4
Show file tree
Hide file tree
Showing 15 changed files with 1,005 additions and 127 deletions.
150 changes: 127 additions & 23 deletions README.html

Large diffs are not rendered by default.

154 changes: 128 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,13 @@ graph TB
```
</td>
<td>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/minimal_graph.mtlx">MTLX</a>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/minimal_graph.gltf">GLTF</a>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/minimal_graph.mtlx">MTLX</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/minimal_graph.gltf">GLTF</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/minimal_graph_fromgltf.mtlx">MTLX from GLTF</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/minimal_graph.usda">USD</a>
</td>
<td><img src="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/minimal_graph.png?raw=true">
<td>
<img src="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/minimal_graph.png?raw=true">
</td>
</tr>
</table>
Expand Down Expand Up @@ -200,11 +202,13 @@ graph TB
```
</td>
<td>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/add_graph.mtlx">MTLX</a>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/add_graph.gltf">GLTF</a>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/add_graph.mtlx">MTLX</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/add_graph.gltf">GLTF</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/add_graph_fromgltf.mtlx">MTLX from GLTF</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/add_graph.usda">USD</a>
</td>
<td><img src="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/add_graph.png?raw=true">
<td>
<img src="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/add_graph.png?raw=true">
</td>
</tr>

Expand Down Expand Up @@ -258,8 +262,9 @@ graph TB
```
</td>
<td>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/checkerboard_graph.mtlx">MTLX</a>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/checkerboard_graph.gltf">GLTF</a>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/checkerboard_graph.mtlx">MTLX</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/checkerboard_graph.gltf">GLTF</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/checkerboard_graph_fromgltf.mtlx">MTLX from GLTF</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/checkerboard_graph.usda">USD</a>
</td>
<td><img src="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/checkerboard_graph.png?raw=true">
Expand Down Expand Up @@ -297,8 +302,11 @@ graph TB
```

</td>
<td><a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/no_material.mtlx">MTLX</a>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/no_material.gltf">GLTF</a>
<td>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/no_material.mtlx">MTLX</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/no_material.gltf">GLTF</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/no_material_fromgltf.mtlx">MTLX from GLTF</a>,

<td><img src="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/no_material.png?raw=true">
</tr>

Expand Down Expand Up @@ -344,9 +352,11 @@ graph TB
```

</td>
<td><a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/unsupported_stdsurf.mtlx">MTLX</a>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/unsupported_stdsurf.gltf">GLTF</a>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/unsupported_stdsurf.usda">USD</a>
<td>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/unsupported_stdsurf.mtlx">MTLX</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/unsupported_stdsurf.gltf">GLTF</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/unsupported_stdsurf_fromgltf.mtlx">MTLX from GLTF</a>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/unsupported_stdsurf.usda">USD</a>,
</td>
<td><img src="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/unsupported_stdsurf.png?raw=true"> (original)
<img src="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/no_material.png?raw=true"> (skipping material )
Expand Down Expand Up @@ -383,9 +393,11 @@ graph TB
```

</td>
<td><a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_simple_filetexture.mtlx">MTLX</a>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_simple_filetexture.gltf">GLTF</a>
<td><a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_simple_filetexture.mtlx">MTLX</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_simple_filetexture.gltf">GLTF</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_simple_filetexture_fromgltf.mtlx">MTLX from GLTF</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_simple_filetexture.usda">USD</a>

<td><img src="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_simple_filetexture.png?raw=true">
</tr>

Expand Down Expand Up @@ -427,9 +439,12 @@ graph TB
```

</td>
<td><a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_shared_filetexture.mtlx">MTLX</a>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_shared_filetexture.gltf">GLTF</a>
<td>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_shared_filetexture.mtlx">MTLX</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_shared_filetexture.gltf">GLTF</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_shared_filetexture_fromgtlf.mtlx">MTLX from GLTF</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_shared_filetexture.usda">USD</a>

<td><img src="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_shared_filetexture.png?raw=true">
</tr>

Expand Down Expand Up @@ -477,13 +492,91 @@ graph TB
```

</td>
<td><a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_shared_filetexture_2.mtlx">MTLX</a>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_shared_filetexture_2.gltf">GLTF</a>
<td>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_shared_filetexture_2.mtlx">MTLX</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_shared_filetexture_2.gltf">GLTF</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_shared_filetexture_2_fromgltf.mtlx">MTLX from GLTF</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_shared_filetexture_2.usda">USD</a>

<td><img src="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/bindings/gltf_shared_filetexture_2.png?raw=true">
</tr>

<tr>
<td>
Procedural graph with intermediary node for shader translation (from standard surface to glTF PBR)

- Graph count: multiple
- Graph inputs: none
- Graph outputs: single
- Compound nodes: yes
- Translation node: yes
- Downstream shader: gltf PBR

```mermaid
graph LR
surfacematerial_material1([surfacematerial_material1])
style surfacematerial_material1 fill:#090, color:#FFF
gltf_pbr[gltf_pbr]
subgraph translation_graph
translation_graph_base_color_out([base_color_out])
style translation_graph_base_color_out fill:#09D, color:#FFF
translation_graph_metallic_out([metallic_out])
style translation_graph_metallic_out fill:#09D, color:#FFF
translation_graph_roughness_out([roughness_out])
style translation_graph_roughness_out fill:#09D, color:#FFF
translation_graph_transmission_out([transmission_out])
style translation_graph_transmission_out fill:#09D, color:#FFF
translation_graph_thickness_out([thickness_out])
style translation_graph_thickness_out fill:#09D, color:#FFF
translation_graph_attenuation_color_out([attenuation_color_out])
style translation_graph_attenuation_color_out fill:#09D, color:#FFF
translation_graph_sheen_color_out([sheen_color_out])
style translation_graph_sheen_color_out fill:#09D, color:#FFF
translation_graph_sheen_roughness_out([sheen_roughness_out])
style translation_graph_sheen_roughness_out fill:#09D, color:#FFF
translation_graph_clearcoat_out([clearcoat_out])
style translation_graph_clearcoat_out fill:#09D, color:#FFF
translation_graph_clearcoat_roughness_out([clearcoat_roughness_out])
style translation_graph_clearcoat_roughness_out fill:#09D, color:#FFF
translation_graph_emissive_out([emissive_out])
style translation_graph_emissive_out fill:#09D, color:#FFF
translation_graph_ss_to_gltf[ss_to_gltf]
end
gltf_pbr --"surfaceshader"--> surfacematerial_material1
translation_graph_base_color_out --"base_color"--> gltf_pbr
translation_graph_metallic_out --"metallic"--> gltf_pbr
translation_graph_roughness_out --"roughness"--> gltf_pbr
translation_graph_transmission_out --"transmission"--> gltf_pbr
translation_graph_sheen_color_out --"sheen_color"--> gltf_pbr
translation_graph_sheen_roughness_out --"sheen_roughness"--> gltf_pbr
translation_graph_clearcoat_out --"clearcoat"--> gltf_pbr
translation_graph_clearcoat_roughness_out --"clearcoat_roughness"--> gltf_pbr
translation_graph_emissive_out --"emissive"--> gltf_pbr
translation_graph_thickness_out --"thickness"--> gltf_pbr
translation_graph_attenuation_color_out --"attenuation_color"--> gltf_pbr
translation_graph_ss_to_gltf --"base_color_out"--> translation_graph_base_color_out
translation_graph_ss_to_gltf --"metallic_out"--> translation_graph_metallic_out
translation_graph_ss_to_gltf --"roughness_out"--> translation_graph_roughness_out
translation_graph_ss_to_gltf --"transmission_out"--> translation_graph_transmission_out
translation_graph_ss_to_gltf --"thickness_out"--> translation_graph_thickness_out
translation_graph_ss_to_gltf --"attenuation_color_out"--> translation_graph_attenuation_color_out
translation_graph_ss_to_gltf --"sheen_color_out"--> translation_graph_sheen_color_out
translation_graph_ss_to_gltf --"sheen_roughness_out"--> translation_graph_sheen_roughness_out
translation_graph_ss_to_gltf --"clearcoat_out"--> translation_graph_clearcoat_out
translation_graph_ss_to_gltf --"clearcoat_roughness_out"--> translation_graph_clearcoat_roughness_out
translation_graph_ss_to_gltf --"emissive_out"--> translation_graph_emissive_out
```

</td>
<td>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/tests/data/shader_translation.mtlx">MTLX</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/tests/data/shader_translation.gltf">GLTF</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/tests/data/shader_translation_fromgltf.mtlx">MTLX from GLTF</a>
<!-- <a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/tests/data/shader_translation.usda">USD</a> -->
</td>
<td><img src="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/tests/data/shader_translation.png">
</td>
</tr>
<td>Example MaterialX version of "boombox" example (from Khronos sample assets) that shows file name resolving.

- Graph count: single
Expand Down Expand Up @@ -512,10 +605,13 @@ graph LR
```

</td>
<td><a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/gltf_examples/gltf_pbr_boombox.mtlx">MTLX</a>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/gltf_examples/gltf_pbr_boombox.gltf">GLTF</a>
<td>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/gltf_examples/gltf_pbr_boombox.mtlx">MTLX</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/gltf_examples/gltf_pbr_boombox.gltf">GLTF</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/gltf_examples/gltf_pbr_boombox_fromgltf.mtlx">MTLX from GLTF</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/gltf_examples/gltf_pbr_boombox.usda">USD</a>
</td>

<td><img src="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/gltf_examples/gltf_pbr_boombox.png?raw=true">
</td>
</tr>
Expand Down Expand Up @@ -599,23 +695,29 @@ graph LR
```

</td>
<td><a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/supported_types.mtlx">MTLX</a>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/supported_types.gltf">GLTF</a>
<td>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/supported_types.mtlx">MTLX</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/supported_types.gltf">GLTF</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/supported_types_fromgltf.mtlx">MTLX from GLTF</a>
<!-- <a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/supported_types.usda">USD</a> -->
</td>

<td><img src="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/supported_types.png?raw=true">
</td>
</tr>

<tr>
<td>Example glTF file which requires name identifier generation to convert to MaterialX (a named based system)

<img src="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/noname_checkerboard_graph_diagram.png?raw=true">
<img src="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/noname_checkerboard_graph_diagram.svg?raw=true">

</td>
<td><a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/noname_checkerboard_graph_fromgltf.mtlx">MTLX</a>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/noname_checkerboard_graph.gltf">GLTF</a>
<td>
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/noname_checkerboard_graph_fromgltf.mtlx">MTLX</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/noname_checkerboard_graph.gltf">GLTF</a>,
<a href="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/noname_checkerboard_graph_fromgltf.mtlx">MTLX from GLTF</a>
</td>

<td>
<img src="https://github.com/KhronosGroup/glTF-MaterialX-Converter/blob/main/tests/data/noname_checkerboard_graph_fromgltf.png?raw=true">
</td>
Expand Down
Loading

0 comments on commit 8ddd4a4

Please sign in to comment.