Skip to content

Commit ddbb672

Browse files
Add hextiled example material (#2356)
This changelist adds a visually-motivated example material for the `hextiledimage` node, providing a reference point for future language implementations and improvements. For visibility, a note about missing implementations of `hextiledimage` and `hextilednormalmap` in MSL, OSL, and MDL has been added to the README.md for the MaterialX data libraries. The two new image assets are from ambientCG (https://ambientcg.com/), which shares them under the Creative Commons CC0 1.0 Universal License (https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/THIRD-PARTY.md#ambientcg-assets). One image asset from very early MaterialX examples (marble.png) has been removed, as it no longer appears to be referenced in our repository.
1 parent e8a7a2c commit ddbb672

8 files changed

Lines changed: 46 additions & 0 deletions

File tree

libraries/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,4 @@ This folder contains the standard data libraries for MaterialX, providing declar
7575
- point, directional, spot
7676
- Shader generation does not currently support:
7777
- `displacementshader` and `volumeshader` nodes for hardware shading targets (GLSL, MSL).
78+
- `hextiledimage` and `hextilednormalmap` for MSL, OSL, and MDL.

resources/Images/marble.png

-1.41 MB
Binary file not shown.

resources/Images/onyx_color.jpg

4.57 MB
Loading
1.65 MB
Loading
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0"?>
2+
<materialx version="1.39" colorspace="lin_rec709">
3+
<nodegraph name="NG_OnyxHextiled" fileprefix="resources/Images/">
4+
<input name="tiling" type="float" value="4.0" uiname="Tiling" uifolder="Hex Tiling" />
5+
<input name="rotation" type="float" value="1.0" uiname="Rotation" uifolder="Hex Tiling" />
6+
<input name="scale" type="float" value="1.0" uiname="Scale" uifolder="Hex Tiling" />
7+
<input name="offset" type="float" value="1.0" uiname="Offset" uifolder="Hex Tiling" />
8+
<input name="falloff" type="float" value="0.75" uiname="Falloff" uifolder="Hex Tiling" />
9+
<convert name="tiling_vector2" type="vector2">
10+
<input name="in" type="float" interfacename="tiling" />
11+
</convert>
12+
<hextiledimage name="image_color" type="color3">
13+
<input name="file" type="filename" value="onyx_color.jpg" colorspace="srgb_texture" />
14+
<input name="tiling" type="vector2" nodename="tiling_vector2" />
15+
<input name="rotation" type="float" interfacename="rotation" />
16+
<input name="scale" type="float" interfacename="scale" />
17+
<input name="offset" type="float" interfacename="offset" />
18+
<input name="falloff" type="float" interfacename="falloff" />
19+
</hextiledimage>
20+
<hextiledimage name="image_roughness" type="color3">
21+
<input name="file" type="filename" value="onyx_roughness.jpg" colorspace="none" />
22+
<input name="tiling" type="vector2" nodename="tiling_vector2" />
23+
<input name="rotation" type="float" interfacename="rotation" />
24+
<input name="scale" type="float" interfacename="scale" />
25+
<input name="offset" type="float" interfacename="offset" />
26+
<input name="falloff" type="float" interfacename="falloff" />
27+
</hextiledimage>
28+
<extract name="image_roughness_float" type="float">
29+
<input name="in" type="color3" nodename="image_roughness" />
30+
<input name="index" type="integer" value="0" />
31+
</extract>
32+
<output name="out_color" type="color3" nodename="image_color" />
33+
<output name="out_roughness" type="float" nodename="image_roughness_float" />
34+
</nodegraph>
35+
<standard_surface name="N_StandardSurface" type="surfaceshader">
36+
<input name="base_color" type="color3" nodegraph="NG_OnyxHextiled" output="out_color" />
37+
<input name="specular_roughness" type="float" nodegraph="NG_OnyxHextiled" output="out_roughness" />
38+
</standard_surface>
39+
<surfacematerial name="M_OnyxHextiled" type="material">
40+
<input name="surfaceshader" type="surfaceshader" nodename="N_StandardSurface" />
41+
</surfacematerial>
42+
</materialx>

source/MaterialXTest/MaterialXGenMdl/GenMdl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class MdlShaderGeneratorTester : public GenShaderUtil::ShaderGeneratorTester
5050
_skipFiles.insert("heighttonormal_in_nodegraph.mtlx");
5151
}
5252

53+
_skipFiles.insert("standard_surface_onyx_hextiled.mtlx");
5354
_skipFiles.insert("hextiled.mtlx");
5455

5556
ShaderGeneratorTester::addSkipFiles();

source/MaterialXTest/MaterialXGenMsl/GenMsl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class MslShaderGeneratorTester : public GenShaderUtil::ShaderGeneratorTester
4343

4444
void addSkipFiles() override
4545
{
46+
_skipFiles.insert("standard_surface_onyx_hextiled.mtlx");
4647
_skipFiles.insert("hextiled.mtlx");
4748
}
4849

source/MaterialXTest/MaterialXGenOsl/GenOsl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class OslShaderGeneratorTester : public GenShaderUtil::ShaderGeneratorTester
4545

4646
void addSkipFiles() override
4747
{
48+
_skipFiles.insert("standard_surface_onyx_hextiled.mtlx");
4849
_skipFiles.insert("hextiled.mtlx");
4950
}
5051

0 commit comments

Comments
 (0)