Skip to content

Commit 907d5f1

Browse files
authored
Merge pull request #92 from ScatteredRay/TextureCoordinateTestMaterialX
Adding MaterialX version of TextureCoordinateTest.
2 parents 5b02cf9 + 262d0b0 commit 907d5f1

File tree

2 files changed

+259
-0
lines changed

2 files changed

+259
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0"?>
2+
<materialx version="1.38" colorspace="lin_rec709">
3+
4+
<nodegraph name="TextureCoordinateTemplate_NodeGraph">
5+
<image name="TextureCoordinateTemplate_Image" type="color3">
6+
<input name="file" type="filename" value="TextureCoordinateTemplate.png" />
7+
</image>
8+
<output name="base_color_output" type="color3" nodename="TextureCoordinateTemplate_Image" />
9+
</nodegraph>
10+
11+
<!-- BackPlaneMat -->
12+
<standard_surface name="BackPlaneMat_Surface" type="surfaceshader">
13+
<input name="base" type="float" value="1" />
14+
<input name="base_color" type="color3" value="0.16000001, 0.16000001, 0.16000001" />
15+
<input name="specular_roughness" type="float" value="1.0" />
16+
</standard_surface>
17+
<surfacematerial name="BackPlaneMat" type="material">
18+
<input name="surfaceshader" type="surfaceshader" nodename="BackPlaneMat_Surface" />
19+
</surfacematerial>
20+
21+
<!-- BottomLeftMat -->
22+
<standard_surface name="BottomLeftMat_Surface" type="surfaceshader">
23+
<input name="base" type="float" value="1" />
24+
<input name="base_color" type="color3" nodegraph="TextureCoordinateTemplate_NodeGraph" output="base_color_output"/>
25+
<input name="specular_roughness" type="float" value="1.0" />
26+
</standard_surface>
27+
<surfacematerial name="BottomLeftMat" type="material">
28+
<input name="surfaceshader" type="surfaceshader" nodename="BottomLeftMat_Surface" />
29+
</surfacematerial>
30+
31+
<!-- BottomRightMat -->
32+
<standard_surface name="BottomRightMat_Surface" type="surfaceshader">
33+
<input name="base" type="float" value="1" />
34+
<input name="base_color" type="color3" nodegraph="TextureCoordinateTemplate_NodeGraph" output="base_color_output"/>
35+
<input name="specular_roughness" type="float" value="1.0" />
36+
</standard_surface>
37+
<surfacematerial name="BottomRightMat" type="material">
38+
<input name="surfaceshader" type="surfaceshader" nodename="BottomRightMat_Surface" />
39+
</surfacematerial>
40+
41+
<!-- TopLeftMat -->
42+
<standard_surface name="TopLeftMat_Surface" type="surfaceshader">
43+
<input name="base" type="float" value="1" />
44+
<input name="base_color" type="color3" nodegraph="TextureCoordinateTemplate_NodeGraph" output="base_color_output"/>
45+
<input name="specular_roughness" type="float" value="1.0" />
46+
</standard_surface>
47+
<surfacematerial name="TopLeftMat" type="material">
48+
<input name="surfaceshader" type="surfaceshader" nodename="TopLeftMat_Surface" />
49+
</surfacematerial>
50+
51+
<!-- TopRightMat -->
52+
<standard_surface name="TopRightMat_Surface" type="surfaceshader">
53+
<input name="base" type="float" value="1" />
54+
<input name="base_color" type="color3" nodegraph="TextureCoordinateTemplate_NodeGraph" output="base_color_output"/>
55+
<input name="specular_roughness" type="float" value="1.0" />
56+
</standard_surface>
57+
<surfacematerial name="TopRightMat" type="material">
58+
<input name="surfaceshader" type="surfaceshader" nodename="TopRightMat_Surface" />
59+
</surfacematerial>
60+
61+
</materialx>
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
#usda 1.0
2+
(
3+
defaultPrim = "Asset"
4+
doc = "Converted from glTF with guc 0.2"
5+
metersPerUnit = 1
6+
upAxis = "Y"
7+
)
8+
9+
def Xform "Asset" (
10+
customData = {
11+
string copyright = "Copyright 2017-2018 Analytical Graphics, Inc., CC-BY 4.0 https://creativecommons.org/licenses/by/4.0/ - Mesh and textures by Ed Mackey."
12+
string generator = "guc conversion from Khronos Blender glTF 2.0 exporter, plus hand-edits"
13+
string version = "2.0"
14+
}
15+
kind = "component"
16+
)
17+
{
18+
def Scope "Materials"
19+
{
20+
def "MaterialX"
21+
{
22+
def Scope "Materials" (
23+
prepend references = @./TextureCoordinateTest.mtlx@</MaterialX/Materials>
24+
)
25+
{
26+
}
27+
}
28+
}
29+
30+
def Xform "Scenes"
31+
{
32+
def Xform "Scene"
33+
{
34+
def Xform "BackPlane"
35+
{
36+
def Xform "BackPlaneMesh"
37+
{
38+
def Mesh "submesh" (
39+
prepend apiSchemas = ["MaterialBindingAPI"]
40+
)
41+
{
42+
uniform bool doubleSided = 1
43+
float3[] extent = [(-1.0, -1.0, -0.05), (1.0, 1.0, -0.05)]
44+
int[] faceVertexCounts = [3, 3]
45+
int[] faceVertexIndices = [0, 1, 2, 0, 3, 1]
46+
rel material:binding = </Asset/Materials/MaterialX/Materials/BackPlaneMat>
47+
normal3f[] normals = [(0.0, 0.0, -1.0), (0.0, 0.0, -1.0), (0.0, 0.0, -1.0), (0.0, 0.0, -1.0)] (
48+
interpolation = "vertex"
49+
)
50+
point3f[] points = [(-1.0, 1.0, -0.05), (1.0, -1.0, -0.05), (-1.0, -1.0, -0.05), (1.0, 1.0, -0.05)]
51+
color3f[] primvars:displayColor = [(0.16, 0.16, 0.16)] (
52+
customData = {
53+
dictionary guc = {
54+
bool generated = 1
55+
}
56+
}
57+
interpolation = "constant"
58+
)
59+
uniform token subdivisionScheme = "none"
60+
}
61+
}
62+
}
63+
64+
def Xform "BottomRightObj"
65+
{
66+
def Xform "BottomRightMesh"
67+
{
68+
def Mesh "submesh" (
69+
prepend apiSchemas = ["MaterialBindingAPI"]
70+
)
71+
{
72+
uniform bool doubleSided = 1
73+
float3[] extent = [(0.2, -1.2, 0.0), (1.2, -0.2, 0.0)]
74+
int[] faceVertexCounts = [3, 3]
75+
int[] faceVertexIndices = [0, 1, 2, 3, 1, 0]
76+
rel material:binding = </Asset/Materials/MaterialX/Materials/BottomRightMat>
77+
normal3f[] normals = [(0.0, 0.0, 1.0), (0.0, 0.0, 1.0), (0.0, 0.0, 1.0), (0.0, 0.0, 1.0)] (
78+
interpolation = "vertex"
79+
)
80+
point3f[] points = [(1.2, -1.2, 0.0), (0.2, -0.2, 0.0), (0.2, -1.2, 0.0), (1.2, -0.2, 0.0)]
81+
color3f[] primvars:displayColor = [(0, 0.8, 0)] (
82+
customData = {
83+
dictionary guc = {
84+
bool generated = 1
85+
}
86+
}
87+
interpolation = "constant"
88+
)
89+
texCoord2f[] primvars:st = [(1.0, 0.0), (0.6, 0.4), (0.6, 0.0), (1.0, 0.4)] (
90+
interpolation = "vertex"
91+
)
92+
uniform token subdivisionScheme = "none"
93+
}
94+
}
95+
}
96+
97+
def Xform "BottomLeftObj"
98+
{
99+
def Xform "BottomLeftMesh"
100+
{
101+
def Mesh "submesh" (
102+
prepend apiSchemas = ["MaterialBindingAPI"]
103+
)
104+
{
105+
uniform bool doubleSided = 1
106+
float3[] extent = [(-1.2, -1.2, 0.0), (-0.2, -0.2, 0.0)]
107+
int[] faceVertexCounts = [3, 3]
108+
int[] faceVertexIndices = [0, 1, 2, 3, 1, 0]
109+
rel material:binding = </Asset/Materials/MaterialX/Materials/BottomLeftMat>
110+
normal3f[] normals = [(0.0, 0.0, 1.0), (0.0, 0.0, 1.0), (0.0, 0.0, 1.0), (0.0, 0.0, 1.0)] (
111+
interpolation = "vertex"
112+
)
113+
point3f[] points = [(-0.2, -1.2, 0.0), (-1.2, -0.2, 0.0), (-1.2, -1.2, 0.0), (-0.2, -0.2, 0.0)]
114+
color3f[] primvars:displayColor = [(0, 0.16, 0.8)] (
115+
customData = {
116+
dictionary guc = {
117+
bool generated = 1
118+
}
119+
}
120+
interpolation = "constant"
121+
)
122+
texCoord2f[] primvars:st = [(0.4, 0.0), (0.0, 0.4), (0.0, 0.0), (0.4, 0.4)] (
123+
interpolation = "vertex"
124+
)
125+
uniform token subdivisionScheme = "none"
126+
}
127+
}
128+
}
129+
130+
def Xform "TopRightObj"
131+
{
132+
def Xform "TopRightMesh"
133+
{
134+
def Mesh "submesh" (
135+
prepend apiSchemas = ["MaterialBindingAPI"]
136+
)
137+
{
138+
uniform bool doubleSided = 1
139+
float3[] extent = [(0.2, 0.2, 0.0), (1.2, 1.2, 0.0)]
140+
int[] faceVertexCounts = [3, 3]
141+
int[] faceVertexIndices = [0, 1, 2, 3, 1, 0]
142+
rel material:binding = </Asset/Materials/MaterialX/Materials/TopRightMat>
143+
normal3f[] normals = [(0.0, 0.0, 1.0), (0.0, 0.0, 1.0), (0.0, 0.0, 1.0), (0.0, 0.0, 1.0)] (
144+
interpolation = "vertex"
145+
)
146+
point3f[] points = [(1.2, 0.2, 0.0), (0.2, 1.2, 0.0), (0.2, 0.2, 0.0), (1.2, 1.2, 0.0)]
147+
color3f[] primvars:displayColor = [(0.8, 0.08, 0)] (
148+
customData = {
149+
dictionary guc = {
150+
bool generated = 1
151+
}
152+
}
153+
interpolation = "constant"
154+
)
155+
texCoord2f[] primvars:st = [(1.0, 0.6), (0.6, 1.0), (0.6, 0.6), (1.0, 1.0)] (
156+
interpolation = "vertex"
157+
)
158+
uniform token subdivisionScheme = "none"
159+
}
160+
}
161+
}
162+
163+
def Xform "TopLeftObj"
164+
{
165+
def Xform "TopLeftMesh"
166+
{
167+
def Mesh "submesh" (
168+
prepend apiSchemas = ["MaterialBindingAPI"]
169+
)
170+
{
171+
uniform bool doubleSided = 1
172+
float3[] extent = [(-1.2, 0.2, 0.0), (-0.2, 1.2, 0.0)]
173+
int[] faceVertexCounts = [3, 3]
174+
int[] faceVertexIndices = [0, 1, 2, 3, 1, 0]
175+
rel material:binding = </Asset/Materials/MaterialX/Materials/TopLeftMat>
176+
normal3f[] normals = [(0.0, 0.0, 1.0), (0.0, 0.0, 1.0), (0.0, 0.0, 1.0), (0.0, 0.0, 1.0)] (
177+
interpolation = "vertex"
178+
)
179+
point3f[] points = [(-0.2, 0.2, 0.0), (-1.2, 1.2, 0.0), (-1.2, 0.2, 0.0), (-0.2, 1.2, 0.0)]
180+
color3f[] primvars:displayColor = [(0.8, 0.8, 0)] (
181+
customData = {
182+
dictionary guc = {
183+
bool generated = 1
184+
}
185+
}
186+
interpolation = "constant"
187+
)
188+
texCoord2f[] primvars:st = [(0.4, 0.6), (0.0, 1.0), (0.0, 0.6), (0.4, 1.0)] (
189+
interpolation = "vertex"
190+
)
191+
uniform token subdivisionScheme = "none"
192+
}
193+
}
194+
}
195+
}
196+
}
197+
}
198+

0 commit comments

Comments
 (0)