-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathREADME.html
More file actions
708 lines (642 loc) · 26 KB
/
README.html
File metadata and controls
708 lines (642 loc) · 26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
<!DOCTYPE html>
<html>
<head>
<title>README.md</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<style>
/* https://github.com/microsoft/vscode/blob/master/extensions/markdown-language-features/media/markdown.css */
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
body {
font-family: var(--vscode-markdown-font-family, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif);
font-size: var(--vscode-markdown-font-size, 14px);
padding: 0 26px;
line-height: var(--vscode-markdown-line-height, 22px);
word-wrap: break-word;
}
#code-csp-warning {
position: fixed;
top: 0;
right: 0;
color: white;
margin: 16px;
text-align: center;
font-size: 12px;
font-family: sans-serif;
background-color:#444444;
cursor: pointer;
padding: 6px;
box-shadow: 1px 1px 1px rgba(0,0,0,.25);
}
#code-csp-warning:hover {
text-decoration: none;
background-color:#007acc;
box-shadow: 2px 2px 2px rgba(0,0,0,.25);
}
body.scrollBeyondLastLine {
margin-bottom: calc(100vh - 22px);
}
body.showEditorSelection .code-line {
position: relative;
}
body.showEditorSelection .code-active-line:before,
body.showEditorSelection .code-line:hover:before {
content: "";
display: block;
position: absolute;
top: 0;
left: -12px;
height: 100%;
}
body.showEditorSelection li.code-active-line:before,
body.showEditorSelection li.code-line:hover:before {
left: -30px;
}
.vscode-light.showEditorSelection .code-active-line:before {
border-left: 3px solid rgba(0, 0, 0, 0.15);
}
.vscode-light.showEditorSelection .code-line:hover:before {
border-left: 3px solid rgba(0, 0, 0, 0.40);
}
.vscode-light.showEditorSelection .code-line .code-line:hover:before {
border-left: none;
}
.vscode-dark.showEditorSelection .code-active-line:before {
border-left: 3px solid rgba(255, 255, 255, 0.4);
}
.vscode-dark.showEditorSelection .code-line:hover:before {
border-left: 3px solid rgba(255, 255, 255, 0.60);
}
.vscode-dark.showEditorSelection .code-line .code-line:hover:before {
border-left: none;
}
.vscode-high-contrast.showEditorSelection .code-active-line:before {
border-left: 3px solid rgba(255, 160, 0, 0.7);
}
.vscode-high-contrast.showEditorSelection .code-line:hover:before {
border-left: 3px solid rgba(255, 160, 0, 1);
}
.vscode-high-contrast.showEditorSelection .code-line .code-line:hover:before {
border-left: none;
}
img {
max-width: 100%;
max-height: 100%;
}
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:focus,
input:focus,
select:focus,
textarea:focus {
outline: 1px solid -webkit-focus-ring-color;
outline-offset: -1px;
}
hr {
border: 0;
height: 2px;
border-bottom: 2px solid;
}
h1 {
padding-bottom: 0.3em;
line-height: 1.2;
border-bottom-width: 1px;
border-bottom-style: solid;
}
h1, h2, h3 {
font-weight: normal;
}
table {
border-collapse: collapse;
}
table > thead > tr > th {
text-align: left;
border-bottom: 1px solid;
}
table > thead > tr > th,
table > thead > tr > td,
table > tbody > tr > th,
table > tbody > tr > td {
padding: 5px 10px;
}
table > tbody > tr + tr > td {
border-top: 1px solid;
}
blockquote {
margin: 0 7px 0 5px;
padding: 0 16px 0 10px;
border-left-width: 5px;
border-left-style: solid;
}
code {
font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Courier New", monospace, "Droid Sans Fallback";
font-size: 1em;
line-height: 1.357em;
}
body.wordWrap pre {
white-space: pre-wrap;
}
pre:not(.hljs),
pre.hljs code > div {
padding: 16px;
border-radius: 3px;
overflow: auto;
}
pre code {
color: var(--vscode-editor-foreground);
tab-size: 4;
}
/** Theming */
.vscode-light pre {
background-color: rgba(220, 220, 220, 0.4);
}
.vscode-dark pre {
background-color: rgba(10, 10, 10, 0.4);
}
.vscode-high-contrast pre {
background-color: rgb(0, 0, 0);
}
.vscode-high-contrast h1 {
border-color: rgb(0, 0, 0);
}
.vscode-light table > thead > tr > th {
border-color: rgba(0, 0, 0, 0.69);
}
.vscode-dark table > thead > tr > th {
border-color: rgba(255, 255, 255, 0.69);
}
.vscode-light h1,
.vscode-light hr,
.vscode-light table > tbody > tr + tr > td {
border-color: rgba(0, 0, 0, 0.18);
}
.vscode-dark h1,
.vscode-dark hr,
.vscode-dark table > tbody > tr + tr > td {
border-color: rgba(255, 255, 255, 0.18);
}
</style>
<style>
/* Tomorrow Theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */
/* Tomorrow Comment */
.hljs-comment,
.hljs-quote {
color: #8e908c;
}
/* Tomorrow Red */
.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-regexp,
.hljs-deletion {
color: #c82829;
}
/* Tomorrow Orange */
.hljs-number,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params,
.hljs-meta,
.hljs-link {
color: #f5871f;
}
/* Tomorrow Yellow */
.hljs-attribute {
color: #eab700;
}
/* Tomorrow Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
color: #718c00;
}
/* Tomorrow Blue */
.hljs-title,
.hljs-section {
color: #4271ae;
}
/* Tomorrow Purple */
.hljs-keyword,
.hljs-selector-tag {
color: #8959a8;
}
.hljs {
display: block;
overflow-x: auto;
color: #4d4d4c;
padding: 0.5em;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
</style>
<style>
/*
* Markdown PDF CSS
*/
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif, "Meiryo";
padding: 0 12px;
}
pre {
background-color: #f8f8f8;
border: 1px solid #cccccc;
border-radius: 3px;
overflow-x: auto;
white-space: pre-wrap;
overflow-wrap: break-word;
}
pre:not(.hljs) {
padding: 23px;
line-height: 19px;
}
blockquote {
background: rgba(127, 127, 127, 0.1);
border-color: rgba(0, 122, 204, 0.5);
}
.emoji {
height: 1.4em;
}
code {
font-size: 14px;
line-height: 19px;
}
/* for inline code */
:not(pre):not(.hljs) > code {
color: #C9AE75; /* Change the old color so it seems less like an error */
font-size: inherit;
}
/* Page Break : use <div class="page"/> to insert page break
-------------------------------------------------------- */
.page {
page-break-after: always;
}
</style>
<script src="https://unpkg.com/mermaid/dist/mermaid.min.js"></script>
</head>
<body>
<script>
mermaid.initialize({
startOnLoad: true,
theme: document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')
? 'dark'
: 'default'
});
</script>
<!--Start-->
<h2 class="bg-gradient rounded-2 p-0" style="display: flex; align-items: center; gap: 10px;">
<img class="px-1" src="https://raw.githubusercontent.com/kwokcb/materialxMaterials/refs/heads/main/documents/images/download.png" width=48px alt="MaterialX Materials Icon">
<span>MaterialX Materials</span>
</h2>
<div class="container-fluid p-2 rounded-4 border border-secondary border-rounded">
<h3>Introduction</h3>
<p>This site hosts a set of libraries and utilities to query remote databases for materials which can either be mapped to MaterialX materials or are natively stored in that format.</p>
<p><strong>Last Updated</strong>: January, 2026 (1.39.5 in progress)</p>
<p><strong>Supported Libraries</strong></p>
<div style="display: flex; align-items: center;">
<img src="https://raw.githubusercontent.com/AntonPalmqvist/physically-based-api/main/images/renders/cycles/600/aluminum.jpeg" width="64px" style="margin-right: 5px;">
<a href="https://physicallybased.info/">PhysicallyBased database</a> Material descriptions can be downloaded with additional utilities to create materials using either: Autodesk Standard Surface, OpenPBR, or glTF PBR shading model shaders.
</div>
<br>
<div style="display: flex; align-items: center;">
<img src="https://image.matlib.gpuopen.com/afff0c66-dba8-4d79-b96b-459fbd9cbef5.jpeg" width="64px" style="margin-right: 5px;">
<a href="https://matlib.gpuopen.com/main/materials/all">AMD GPUOpen database</a> MaterialX packages can be downloaded (as zip files). Images and MaterialX documents can be extracted for any of the posted materials in the database.
</div>
<br>
<div style="display: flex; align-items: center;">
<img src="https://acg-media.struffelproductions.com/file/ambientCG-Web/media/thumbnail/2048-JPG-242424/PavingStones142.jpg" width="64px" style="margin-right: 5px;">
<a href="https://ambientcg.com/list?type=material&sort=popular">ambientCG database</a> MaterialX packages can be downloaded (as zip files). Images and MaterialX documents can be extracted for any of the posted materials in the database.
</div>
<br>
<div style="display: flex; align-items: center;">
<img src="https://polyhaven.com/Logo%20256.png" width="64px" style="margin-right: 5px;">
<a href="https://polyhaven.com/">PolyHaven Library</a> MaterialX assets can be downloaded (as zip files). Images and MaterialX documents can be extracted for any of the posted materials in the database.
</div>
</p>
Each currently has <code>Python</code> and / or <code>Javascript</code> implementations.
<h3>Links</h3>
<ul>
<li><a href="https://kwokcb.github.io/materialxMaterials" target="_blank">Home Page</a></li>
<li>Main tooling site: <div class="btn btn-outline-secondary"><br>
<a href="https://kwokcb.github.io/MaterialXLab" target="_blank"><img src="https://kwokcb.github.io/MaterialXLab/documents/icons/teapot_logo.svg" height=24px> MaterialXLab</a></li>
</ul>
</div>
- The API reference can be found <a href="https://kwokcb.github.io/materialxMaterials/documents/html/index.html">here</a>
- <a href="https://github.com/kwokcb/materialxMaterials"><img src="https://raw.githubusercontent.com/kwokcb/materialxMaterials/4125d04c73fc2b1755f5b6054b25b6d1bdabcf6b/documents/icons/github-mark-white.svg" width=16px> GitHub repository</a>.
<p>A <code>Jupyter</code> notebook demonstrates the direct usage of the Python library. The output of the notebook can be found <a href="https://kwokcb.github.io/materialxMaterials/examples/materialxMaterials_tutorial_out_iframe.html">here</a>. The notebook can found in the Github repository under the <code>examples</code> folder.</p>
<h4>Examples</h4>
<p>The following are some samples which have been rendered using the <code>MaterialXView</code> utility which is part of the MaterialX binary distribution.</p>
<p>See the <a href="https://kwokcb.github.io/materialxMaterials/examples/index.html">Examples pages</a> for further details.</p>
<table>
<tr>
<td>
<b>GPUOpen</b>
<table>
<tr>
<td>
<img src="https://kwokcb.github.io/materialxMaterials/src/materialxMaterials/data/GPUOpenMaterialX/Emerald Peaks Wallpaper/Emerald_Peaks_Wallpaper.png" width=256px><br>
Emerald Peaks Wallpaper
</td>
<td>
<img src="https://kwokcb.github.io/materialxMaterials/src/materialxMaterials/data/GPUOpenMaterialX/Indigo Palm Wallpaper/Indigo_Palm_Wallpaper.png" width=256px><br>
Indigo Palm Wallpaper
</td>
<td>
<img src="https://kwokcb.github.io/materialxMaterials/src/materialxMaterials/data/GPUOpenMaterialX/Oliana Blue Painted Wood/Oliana_Blue_Painted_Wood.png" width=256px><br>
Oliana Blue Painted Wood
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<b>PhysicallyBased</b>
<table>
<tr>
<td>
<img src="https://kwokcb.github.io/materialxMaterials/src/materialxMaterials/data/PhysicallyBasedMaterialX/Ketchup.png" width=256px><br>
Ketchup
</td>
<td>
<img src="https://kwokcb.github.io/materialxMaterials/src/materialxMaterials/data/PhysicallyBasedMaterialX/Cooking_Oil.png" width=256px><br>
Cooking Oil
</td>
<td>
<img src="https://kwokcb.github.io/materialxMaterials/src/materialxMaterials/data/PhysicallyBasedMaterialX/Brass.png" width=256px><br>
Brass
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<b>ambientCG</b>
<table>
<tr>
<td>
<img src="https://kwokcb.github.io/materialxMaterials/src/materialxMaterials/data/ambientCgMaterials/Metal053C_1K-PNG.png" width=256px><br>
Metal (53)
</td>
<td>
<img src="https://kwokcb.github.io/materialxMaterials/src/materialxMaterials/data/ambientCgMaterials/PavingStones142_1K-PNG.png" width=256px><br>
Paving Stones (142)
</td>
<td>
<img src="https://kwokcb.github.io/materialxMaterials/src/materialxMaterials/data/ambientCgMaterials/WoodFloor038_1K-PNG.png" width=256px><br>
Wood Floor (38)
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<b>PolyHaven</b>
<table>
<!-- https://kwokcb.github.io/materialxMaterials/src/materialxMaterials/ -->
<tr>
<td>
<img src="https://raw.githubusercontent.com/kwokcb/materialxMaterials/refs/heads/main/examples/PolyHaven/aerial_asphalt_01_1k_materialx/aerial_asphalt_01_1k.png" width="256px"><br>
Ashphalt 1
</td>
<td>
<img src="https://github.com/kwokcb/materialxMaterials/blob/main/examples/PolyHaven/aerial_rocks_02_1k_materialx/aerial_rocks_02_1k.png?raw=true" width="256px"><br>
Rocks 2
</td>
<td>
<img src="https://github.com/kwokcb/materialxMaterials/blob/main/examples/PolyHaven/wood_trunk_wall_1k_materialx/wood_trunk_wall_1k.png?raw=true" width="256px"><br>
Wood Trunk Wall
</td>
</tr>
</table>
</td>
</tr>
</table>
</div><p><div class="container-fluid p-2 rounded-4 border border-secondary border-rounded">
<h3>Details</h3>
<table class="p-2 container-fluid p-2 border border-outline-secondary">
<tr class="row-sm">
<td class="col-sm p-2 border border-outline-secondary">
<h4>1. PhysicallyBased</h4>
<p>An <a href="https://kwokcb.github.io/MaterialXLab/javascript/PhysicallyBasedMaterialX_out.html" target="_blank">interactive page</a> for extracting <code>PhysicallyBased</code> uses a Javascript implementation found <a href="https://github.com/kwokcb/materialxMaterials/blob/main/javascript/JsMaterialXPhysicallyBased.js">here</p>
<img src="https://raw.githubusercontent.com/kwokcb/materialxMaterials/refs/heads/main/documents/images/physicallyBased_material_fetch.png" width=512px/>
</a>
</td>
<td class="col-sm p-2 border border-outline-secondary">
<h4>2. AMD GPUOpen</h4>
<p>A command line utility is available <a href="https://github.com/kwokcb/materialxMaterials/tree/main/javascript/JsGPUOpenLoaderPackage">here</a>. This uses <code>Node.js</code> to allow access to fetch materials from the <code>GPU Open</code> site(which is not available via a web page).</p>
<p><a href="https://github.com/kwokcb/materialxWeb/blob/main/flask/gpuopen/README.md">A <b>Flask</b> application</a> is also available which uses the Python package with a Web based front here.
<br>
<img src="https://raw.githubusercontent.com/kwokcb/materialxWeb/refs/heads/main/flask/gpuopen/images/extract_material_2.png" width=512px>
</p>
</td>
<tr>
<td class="col-sm p-2 border border-outline-secondary">
<h4>3. ambientCg</h4>
<p>A sample <a href="https://materialx-materials-library-inspector.onrender.com/"><br>
<b>NodeJS / Express</b></a> application is available from the <a href="https://kwokcb.github.io/materialxWeb/index.html" target="_blank">MaterialXWeb</a> site. <code>Flask</code> deployment is on <code>Render</code>.</p>
<p>This is designed to be a general purpose MaterialX <em>material inspector</em> supporting <code>ambientCg</code> and <code>GPUOpen</code> currently with the intent to add new libraries as they become available.</p>
<img src="https://github.com/kwokcb/materialxWeb/blob/main/nodejs/materialxLibraryInspector/public/images/ambientCg_download_2.png?raw=true" width=512px>
</td>
<td class="col-sm p-2 border border-outline-secondary">
<h4>4. PolyHaven</h4>
<p>A Python library and command <code>polyHavenLoader</code> and <code>polyHavenLoaderCmd</code> can be used to get a list of assets which can be downloaded in zip<br>
format.</p>
<p>A Javascript library and Web interface is available <a href="https://kwokcb.github.io/materialxMaterials/javascript/JsPolyHaven/" target="__default"><b>here</b>.<br>
<br></p>
<table>
<tr>
<td><img src="https://kwokcb.github.io/materialxMaterials/documents/images/PolyHaven_Page_0.png" width=320px></td>
<!-- <td><img src="https://kwokcb.github.io/materialxMaterials/documents/images/PolyHaven_Page_1a.png" width=256px></td> -->
<!-- <td><img src="https://kwokcb.github.io/materialxMaterials/documents/images/PolyHaven_Page_1b.png" height=256px></td> -->
</tr>
</table>
</a>
<p>Filtering by classification, name tags, and dependent image resolution is available. Materials may be previewed and / or saved.</p>
</td>
</td>
</table>
</div><p><div class="container-fluid p-2 rounded-4 border border-secondary border-rounded">
<h3>Visualization and Inspection</h3>
<p>The content can be loaded into any publicly available MaterialX viewer or editor. The <a href="https://kwokcb.github.io/MaterialXLab/" target="_blank">MaterialXLab</a> site includes a Node Editor which can load materials from all four libraries directly.</p>
<h4>MaterialXLab Node Editor</h4>
<p>
Below are screenshots of materials fetched from <code>PhysicallyBased</code>, <code>GPU Open</code>, <code>ambientCg></code> and <code>PolyHaven</code> (left to right images respectively).
<p>Note that the material zip from <code>GPU Open</code> and <code>ambientCg</code> is directly read into the editor via it's zip loading option. <code>PolyHaven</code> packages material content into a zip to allow loading via the zip loading option.</p>
<table>
<tr>
<td><img src="https://kwokcb.github.io/MaterialXLab/documents/help/images/load_phybased_node_editor.png" width=256px></td>
<td><img src="https://kwokcb.github.io/MaterialXLab/documents/help/images/load_zip_node_editor_3.png" width=256px></td>
<td><img src="https://kwokcb.github.io/MaterialXLab/documents/help/images/load_ambientCG_node_editor.png" width=256px></td>
<td><img src="https://kwokcb.github.io/materialxMaterials/documents/images/load_polyhaven_node_editor.png" width=256px></td>
</tr>
</table>
</p>
<p>Support is also available on the MaterialXLab site for
the shader introspection, node definition publishing, and
graphing / diagramming </p>
<h4>Example Usage</h4>
<iframe
src="https://www.youtube.com/embed/4KiPW9IUR6U?rel=0&vq=hd1080"
title="Using Material Libraries" width="100%"
height="600px" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe>
</div><p><div class="container-fluid p-2 rounded-4 border border-secondary border-rounded">
<h3>Library Dependencies</h3>
<p>The Python utilities require:</p>
<ol>
<li>The <code>MaterialX</code> 1.39 or greater package for PhysicallyBased OpenPBR shader creation. The current build is against 1.39.5.</li>
<li>The <code>requests</code> package.</li>
<li>The <code>pillow</code> package for image handling for GPUOpen package handling (optional)</li>
</ol>
<p>The JavaScript utilities require:</p>
<ol>
<li><code>javascript/JsGPUOpenLoaderPackage</code>:</li>
</ol>
<ul>
<li><code>node-fetch</code> (for HTTP requests)</li>
<li><code>yargs</code> (for command line parsing)</li>
</ul>
<ol start="2">
<li><code>javascript/JSEXRViewer</code>:</li>
</ol>
<ul>
<li><code>express</code> (for running the web server)</li>
</ul>
</div><p><div class="container-fluid p-2 rounded-4 border border-secondary border-rounded">
<h3>Package Building</h3>
<p>The <a href="https://github.com/kwokcb/materialxMaterials"><img src="https://raw.githubusercontent.com/kwokcb/materialxMaterials/4125d04c73fc2b1755f5b6054b25b6d1bdabcf6b/documents/icons/github-mark-white.svg" width=16px> GitHub repository</a> can be cloned.</p>
<p>The Python package can be built using:</p>
<pre class="hljs"><code><div>pip install .
</div></code></pre>
<p>This will pull down the dependent Python packages as needed.</p>
<p>Build scripts can be found in the <code>utilities</code> folder.</p>
<ul>
<li><code>build.sh</code> will install the package and run package commands to update package data.</li>
<li><code>buildDocs.sh</code> will prepare documents and run Doxygen to build API docs.</li>
<li><code>build_examples.sh</code> will download material examples and optionally render them. <code>PhysicallyBased</code> rendering requires <code>MaterialXView</code> to be installed.</li>
</ul>
<p>The Javascript utilities require <code>Node.js</code> to be installed. From the package folders<br>
the following should be run:</p>
<pre class="hljs"><code><div>npm install # Install dependent packages
npm run [build/start] # Build distribution or run the package
</div></code></pre>
</div><p><div class="container-fluid p-2 rounded-4 border border-secondary border-rounded">
<h3>Command Line Interfaces</h3>
<h4>PhysicallyBased</h4>
<ul>
<li>
<p>Query all materials fom PhysicallyBased and convert them to all support shading models. Save the material list and corresponding MaterialX files in the default output location. The build will include this information Python package under the <code>data</code> folder.</p>
<pre class="hljs"><code><div>python physicallyBasedMaterialXCmd.py
</div></code></pre>
<p>or</p>
<pre class="hljs"><code><div>materialxMaterials physbased
</div></code></pre>
</li>
</ul>
<h4>GPUOpen</h4>
<ul>
<li>
<p>Query all materials fom GPUOpen. Extract out a few material packages (zip). Save the material lists, material names and unzipped packages (MaterialX and images) in the default output location. The build will include this information Python package under the <code>data</code> folder.</p>
<pre class="hljs"><code><div>materialxMaterials gpuopen --materialNames=1 --saveMaterials=1
</div></code></pre>
</li>
</ul>
<h4>ambientCG</h4>
<ul>
<li>
<p>Download the materials list fom ambientCG:</p>
<pre class="hljs"><code><div>materialxMaterials acg --saveMaterials True
</div></code></pre>
</li>
<li>
<p>Extract out a material package for the "WoodFloor038" material from ambientCG requesting the<br>
package where the images are 2K PNG files:</p>
<pre class="hljs"><code><div>materialxMaterials acg --downloadMaterial <span class="hljs-string">"WoodFloor038"</span> --downloadResolution 2
</div></code></pre>
</li>
</ul>
<h4>PolyHaven</h4>
<ul>
<li>
<p>Examine all texture assets on PolyHaven, and find all ones which have MaterialX resources.</p>
<pre class="hljs"><code><div>polyHavenLoaderCmd.py -fe
</div></code></pre>
</li>
<li>
<p>The extraction can be filtered by identifier:</p>
<pre class="hljs"><code><div>polyHavenLoaderCmd.py -fe -id=<span class="hljs-string">"aerial_asphalt_01"</span>
</div></code></pre>
</li>
<li>
<p>or by count. In this case the first 10 assets with MaterialX resources will be extracted.</p>
<pre class="hljs"><code><div>polyHavenLoaderCmd.py -fe -c 10
</div></code></pre>
</li>
</ul>
<p>Note that this does not download any of the content for each asset, but instead<br>
extract information into a file called <code>polyhaven_materialx_assets.json</code> for later usage.. The build process will include a file with this name under the <code>data</code> as part of the Python package. This avoids having to query the PolyHaven API repeatedly.</p>
<ul>
<li>
<p>The user can either use a local version of this file by specifying the path the file as shown below, where an optional <code>--data_folder</code> argument can be used to specify the location of the file.</p>
<pre class="hljs"><code><div>python -m materialxMaterials polyhaven --load [--data-folder <myfolder location> -id=<span class="hljs-string">"aerial_asphalt_01"</span>
</div></code></pre>
</li>
<li>
<p>If <code>--load</code> is not specified then the the packaged will be used by default.</p>
<pre class="hljs"><code><div>python -m materialxMaterials polyhaven -id=<span class="hljs-string">"aerial_asphalt_01"</span>
</div></code></pre>
</li>
</ul>
<p>Download options include:</p>
<ol>
<li>
<p><code>-x</code> or <code>--extract</code> to extract the content of the package (MaterialX and images) into a folder. By default the package will be downloaded but not extracted.</p>
</li>
<li>
<p><code>-exr</code> or <code>--keep_exr</code> to keep the EXR files if they are included in the package. By default the equivalent PNG files are downloaded or EXR files are converted to PNG files. The latter requires the <code>OpenImageIO</code> package to be installed.</p>
<ul>
<li>Note that if EXR images are remapped then the MaterialX file references<br>
are also remapped in the <code>.mtlx</code> file.</li>
</ul>
</li>
<li>
<p><code>-r</code> or <code>--download_resolution</code> to specify the resolution of the images to download. By default the lowest resolution images are downloaded. The user can specify "1k", "2k", "4k" or "8k".</p>
</li>
</ol>
<h4>GPUOpen (NodeJS)</h4>
<p>The utility can be run from the <code>javascript\JsGPUOpenLoaderPackage</code> folder as follows:</p>
<pre class="hljs"><code><div>npm start -- [<arguments>]
</div></code></pre>
<p>or:</p>
<pre class="hljs"><code><div>node gpuOpenFetch.js [<arguments>]
</div></code></pre>
<p>with the appropriate arguments. It supports the same options as the Python utility -- namely material information, and package (zip) downloads. For the following 2 lines are equivalent to download a material called "Moss Green Solid Granite".</p>
<pre class="hljs"><code><div>node gpuOpenFetch.js -n "Moss Green Solid Granite"
npm start -- -n "Moss Green Solid Granite"
</div></code></pre>
</div>
<!--End-->
</body>
</html>