forked from AcademySoftwareFoundation/MaterialX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pbrlib_defs.mtlx
397 lines (361 loc) · 20.4 KB
/
pbrlib_defs.mtlx
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
<?xml version="1.0"?>
<materialx version="1.38">
<!--
TM & (c) 2018 Lucasfilm Entertainment Company Ltd. and Lucasfilm Ltd.
All rights reserved. See LICENSE.txt for license.
Declarations of standard data types and nodes included in the MaterialX specification.
-->
<!-- ======================================================================== -->
<!-- Data Types -->
<!-- ======================================================================== -->
<typedef name="BSDF" doc="Bidirectional scattering distribution function" />
<typedef name="EDF" doc="Emission distribution function" />
<typedef name="VDF" doc="Volume distribution function" />
<!-- ======================================================================== -->
<!-- BSDF Nodes -->
<!-- ======================================================================== -->
<!--
Node: <oren_nayar_diffuse_bsdf>
A BSDF node for diffuse reflection.
-->
<nodedef name="ND_oren_nayar_diffuse_bsdf" node="oren_nayar_diffuse_bsdf" bsdf="R" nodegroup="pbr" doc="A BSDF node for diffuse reflections.">
<input name="weight" type="float" value="1.0" uimin="0.0" uimax="1.0" />
<input name="color" type="color3" value="0.18, 0.18, 0.18" />
<input name="roughness" type="float" value="0.0" />
<input name="normal" type="vector3" defaultgeomprop="Nworld" />
<output name="out" type="BSDF" />
</nodedef>
<!--
Node: <burley_diffuse_bsdf>
A BSDF node for Burley diffuse reflection.
-->
<nodedef name="ND_burley_diffuse_bsdf" node="burley_diffuse_bsdf" bsdf="R" nodegroup="pbr" doc="A BSDF node for Burley diffuse reflections.">
<input name="weight" type="float" value="1.0" uimin="0.0" uimax="1.0" />
<input name="color" type="color3" value="0.18, 0.18, 0.18" />
<input name="roughness" type="float" value="0.0" />
<input name="normal" type="vector3" defaultgeomprop="Nworld" />
<output name="out" type="BSDF" />
</nodedef>
<!--
Node: <translucent_bsdf>
A BSDF node for diffuse transmission.
-->
<nodedef name="ND_translucent_bsdf" node="translucent_bsdf" bsdf="R" nodegroup="pbr" doc="A BSDF node for pure diffuse transmission.">
<input name="weight" type="float" value="1.0" uimin="0.0" uimax="1.0" />
<input name="color" type="color3" value="1.0, 1.0, 1.0" />
<input name="normal" type="vector3" defaultgeomprop="Nworld" />
<output name="out" type="BSDF" />
</nodedef>
<!--
Node: <dielectric_bsdf>
A reflection/transmission BSDF node based on a microfacet model and a Fresnel curve for dielectrics.
-->
<nodedef name="ND_dielectric_bsdf" node="dielectric_bsdf" nodegroup="pbr" doc="A reflection/transmission BSDF node based on a microfacet model and a Fresnel curve for dielectrics.">
<input name="weight" type="float" value="1.0" uimin="0.0" uimax="1.0" />
<input name="tint" type="color3" value="1.0, 1.0, 1.0" />
<input name="ior" type="float" value="1.5" />
<input name="roughness" type="vector2" value="0.05, 0.05" />
<input name="normal" type="vector3" defaultgeomprop="Nworld" />
<input name="tangent" type="vector3" defaultgeomprop="Tworld" />
<input name="distribution" type="string" value="ggx" enum="ggx" uniform="true" />
<input name="scatter_mode" type="string" value="R" enum="R,T,RT" uniform="true" />
<output name="out" type="BSDF" />
</nodedef>
<!--
Node: <conductor_bsdf>
A reflection BSDF node based on a microfacet model and a Fresnel curve for conductors/metals.
-->
<nodedef name="ND_conductor_bsdf" node="conductor_bsdf" bsdf="R" nodegroup="pbr" doc="A reflection BSDF node based on a microfacet model and a Fresnel curve for conductors/metals.">
<input name="weight" type="float" value="1.0" uimin="0.0" uimax="1.0" />
<input name="ior" type="color3" value="0.271, 0.677, 1.316" colorspace="none" />
<input name="extinction" type="color3" value="3.609, 2.625, 2.292" colorspace="none" />
<input name="roughness" type="vector2" value="0.05, 0.05" />
<input name="normal" type="vector3" defaultgeomprop="Nworld" />
<input name="tangent" type="vector3" defaultgeomprop="Tworld" />
<input name="distribution" type="string" value="ggx" enum="ggx" uniform="true" />
<output name="out" type="BSDF" />
</nodedef>
<!--
Node: <generalized_schlick_bsdf>
A reflection/transmission BSDF node based on a microfacet model and a generalized Schlick Fresnel curve.
-->
<nodedef name="ND_generalized_schlick_bsdf" node="generalized_schlick_bsdf" nodegroup="pbr" doc="A reflection/transmission BSDF node based on a microfacet model and a generalized Schlick Fresnel curve.">
<input name="weight" type="float" value="1.0" uimin="0.0" uimax="1.0" />
<input name="color0" type="color3" value="1.0, 1.0, 1.0" />
<input name="color90" type="color3" value="1.0, 1.0, 1.0" />
<input name="exponent" type="float" value="5.0" />
<input name="roughness" type="vector2" value="0.05, 0.05" />
<input name="normal" type="vector3" defaultgeomprop="Nworld" />
<input name="tangent" type="vector3" defaultgeomprop="Tworld" />
<input name="distribution" type="string" value="ggx" enum="ggx" uniform="true" />
<input name="scatter_mode" type="string" value="R" enum="R,T,RT" uniform="true" />
<output name="out" type="BSDF" />
</nodedef>
<!--
Node: <subsurface_bsdf>
A subsurface scattering BSDF for true subsurface scattering.
-->
<nodedef name="ND_subsurface_bsdf" node="subsurface_bsdf" bsdf="R" nodegroup="pbr" doc="A subsurface scattering BSDF for true subsurface scattering.">
<input name="weight" type="float" value="1.0" uimin="0.0" uimax="1.0" />
<input name="color" type="color3" value="0.18, 0.18, 0.18" />
<input name="radius" type="vector3" value="1.0, 1.0, 1.0" />
<input name="anisotropy" type="float" value="0.0" />
<input name="normal" type="vector3" defaultgeomprop="Nworld" />
<output name="out" type="BSDF" />
</nodedef>
<!--
Node: <sheen_bsdf>
A microfacet BSDF for the back-scattering properties of cloth-like materials.
-->
<nodedef name="ND_sheen_bsdf" node="sheen_bsdf" bsdf="R" nodegroup="pbr" doc="A microfacet BSDF for the back-scattering properties of cloth-like materials.">
<input name="weight" type="float" value="1.0" uimin="0.0" uimax="1.0" />
<input name="color" type="color3" value="1.0, 1.0, 1.0" />
<input name="roughness" type="float" value="0.3" />
<input name="normal" type="vector3" defaultgeomprop="Nworld" />
<output name="out" type="BSDF" />
</nodedef>
<!--
Node: <thin_film_bsdf>
Adds an iridescent thin film layer over a microfacet base BSDF.
-->
<nodedef name="ND_thin_film_bsdf" node="thin_film_bsdf" bsdf="R" nodegroup="pbr" doc="Adds an iridescent thin film layer over a microfacet base BSDF.">
<input name="thickness" type="float" value="550" unittype="distance" unit="nanometer" />
<input name="ior" type="float" value="1.5" />
<output name="out" type="BSDF" />
</nodedef>
<!-- ======================================================================== -->
<!-- EDF Nodes -->
<!-- ======================================================================== -->
<!--
Node: <uniform_edf>
An EDF node for uniform emission.
-->
<nodedef name="ND_uniform_edf" node="uniform_edf" nodegroup="pbr" doc="An EDF node for uniform emission.">
<input name="color" type="color3" value="1.0, 1.0, 1.0" />
<output name="out" type="EDF" />
</nodedef>
<!--
Node: <conical_edf>
Constructs an EDF emitting light inside a cone around the normal direction.
-->
<nodedef name="ND_conical_edf" node="conical_edf" nodegroup="pbr" doc="Constructs an EDF emitting light inside a cone around the normal direction.">
<input name="color" type="color3" value="1.0, 1.0, 1.0" />
<input name="normal" type="vector3" defaultgeomprop="Nworld" />
<input name="inner_angle" type="float" value="60.0" />
<input name="outer_angle" type="float" value="0.0" />
<output name="out" type="EDF" />
</nodedef>
<!--
Node: <measured_edf>
Constructs an EDF emitting light according to a measured IES light profile.
-->
<nodedef name="ND_measured_edf" node="measured_edf" nodegroup="pbr" doc="Constructs an EDF emitting light according to a measured IES light profile.">
<input name="color" type="color3" value="1.0, 1.0, 1.0" />
<input name="normal" type="vector3" defaultgeomprop="Nworld" />
<input name="file" type="filename" value="" uniform="true" />
<output name="out" type="EDF" />
</nodedef>
<!-- ======================================================================== -->
<!-- VDF Nodes -->
<!-- ======================================================================== -->
<!--
Node: <absorption_vdf>
Constructs a VDF for pure light absorption.
-->
<nodedef name="ND_absorption_vdf" node="absorption_vdf" nodegroup="pbr" doc="Constructs a VDF for pure light absorption.">
<input name="absorption" type="vector3" value="0.0, 0.0, 0.0" />
<output name="out" type="VDF" />
</nodedef>
<!--
Node: <anisotropic_vdf>
Constructs a VDF scattering light for a participating medium, based on the
Henyey-Greenstein phase function.
-->
<nodedef name="ND_anisotropic_vdf" node="anisotropic_vdf" nodegroup="pbr" doc="Constructs a VDF scattering light for a participating medium, based on the Henyey-Greenstein phase function.">
<input name="absorption" type="vector3" value="0.0, 0.0, 0.0" />
<input name="scattering" type="vector3" value="0.0, 0.0, 0.0" />
<input name="anisotropy" type="float" value="0.0" />
<output name="out" type="VDF" />
</nodedef>
<!-- ======================================================================== -->
<!-- Shader Nodes -->
<!-- ======================================================================== -->
<!--
Node: <surface>
Construct a surface shader from scattering and emission distribution functions.
-->
<nodedef name="ND_surface" node="surface" nodegroup="pbr" doc="A constructor node for the surfaceshader type.">
<input name="bsdf" type="BSDF" value="" doc="Distribution function for surface scattering." />
<input name="edf" type="EDF" value="" doc="Distribution function for surface emission." />
<input name="opacity" type="float" value="1.0" doc="Surface cutout opacity" />
<output name="out" type="surfaceshader" />
</nodedef>
<!--
Node: <thin_surface>
Construct a surface shader from scattering and emission distribution functions for non-closed "thin" objects.
-->
<nodedef name="ND_thin_surface" node="thin_surface" nodegroup="pbr" doc="A constructor node for the surfaceshader type for non-closed 'thin' objects.">
<input name="front_bsdf" type="BSDF" value="" doc="Distribution function for front-side surface scattering." />
<input name="front_edf" type="EDF" value="" doc="Distribution function for front-side surface emission." />
<input name="back_bsdf" type="BSDF" value="" doc="Distribution function for back-side surface scattering." />
<input name="back_edf" type="EDF" value="" doc="Distribution function for back-side surface emission." />
<input name="opacity" type="float" value="1.0" doc="Surface cutout opacity" />
<output name="out" type="surfaceshader" />
</nodedef>
<!--
Node: <volume>
Construct a volume shader describing a participating medium.
-->
<nodedef name="ND_volume" node="volume" nodegroup="pbr" doc="A constructor node for the volumeshader type.">
<input name="vdf" type="VDF" value="" doc="Volume distribution function for the medium." />
<input name="edf" type="EDF" value="" doc="Emission distribution function for the medium." />
<output name="out" type="volumeshader" />
</nodedef>
<!--
Node: <light>
Construct a light shader from emission distribution functions.
-->
<nodedef name="ND_light" node="light" nodegroup="pbr" doc="A constructor node for the lightshader type.">
<input name="edf" type="EDF" value="" doc="Distribution function for light emission." />
<input name="intensity" type="float" value="1.0" doc="Multiplier for the light intensity" />
<input name="exposure" type="float" value="0.0" doc="Exposure control for the light intensity" />
<output name="out" type="lightshader" />
</nodedef>
<!--
Node: <displacement>
Construct a displacement shader.
-->
<nodedef name="ND_displacement_float" node="displacement" nodegroup="pbr" doc="A constructor node for the displacementshader type.">
<input name="displacement" type="float" value="0.0" doc="Scalar displacement amount along the surface normal direction." />
<input name="scale" type="float" value="1.0" doc="Scale factor for the displacement vector" />
<output name="out" type="displacementshader" />
</nodedef>
<nodedef name="ND_displacement_vector3" node="displacement" nodegroup="pbr" doc="A constructor node for the displacementshader type.">
<input name="displacement" type="vector3" value="0.0, 0.0, 0.0" doc="Vector displacement in (dPdu, dPdv, N) tangent/normal space." />
<input name="scale" type="float" value="1.0" doc="Scale factor for the displacement vector" />
<output name="out" type="displacementshader" />
</nodedef>
<!-- ======================================================================== -->
<!-- Utility Nodes -->
<!-- ======================================================================== -->
<!--
Node: <layer>
-->
<nodedef name="ND_layer_bsdf" node="layer" nodegroup="pbr" defaultinput="top" doc="Layer two BSDF's with vertical layering.">
<input name="top" type="BSDF" value="" />
<input name="base" type="BSDF" value="" />
<output name="out" type="BSDF" />
</nodedef>
<!--
Node: <mix>
-->
<nodedef name="ND_mix_bsdf" node="mix" nodegroup="pbr" defaultinput="bg" doc="Mix two BSDF's according to an input mix amount.">
<input name="fg" type="BSDF" value="" />
<input name="bg" type="BSDF" value="" />
<input name="mix" type="float" value="1.0" uimin="0.0" uimax="1.0" doc="Mixing weight, range [0, 1]." />
<output name="out" type="BSDF" />
</nodedef>
<nodedef name="ND_mix_edf" node="mix" nodegroup="pbr" defaultinput="bg" doc="Mix two EDF's according to an input mix amount.">
<input name="fg" type="EDF" value="" />
<input name="bg" type="EDF" value="" />
<input name="mix" type="float" value="1.0" uimin="0.0" uimax="1.0" doc="Mixing weight, range [0, 1]." />
<output name="out" type="EDF" />
</nodedef>
<nodedef name="ND_mix_vdf" node="mix" nodegroup="pbr" defaultinput="bg" doc="Mix two VDF's according to an input mix amount.">
<input name="fg" type="VDF" value="" />
<input name="bg" type="VDF" value="" />
<input name="mix" type="float" value="1.0" uimin="0.0" uimax="1.0" doc="Mixing weight, range [0, 1]." />
<output name="out" type="VDF" />
</nodedef>
<!--
Node: <add>
-->
<nodedef name="ND_add_bsdf" node="add" nodegroup="pbr" defaultinput="bg" doc="A node for additive blending of BSDF's.">
<input name="in1" type="BSDF" value="" doc="First BSDF." />
<input name="in2" type="BSDF" value="" doc="Second BSDF." />
<output name="out" type="BSDF" />
</nodedef>
<nodedef name="ND_add_edf" node="add" nodegroup="pbr" defaultinput="bg" doc="A node for additive blending of EDF's.">
<input name="in1" type="EDF" value="" doc="First EDF." />
<input name="in2" type="EDF" value="" doc="Second EDF." />
<output name="out" type="EDF" />
</nodedef>
<nodedef name="ND_add_vdf" node="add" nodegroup="pbr" defaultinput="bg" doc="A node for additive blending of VDF's.">
<input name="in1" type="VDF" value="" doc="First VDF." />
<input name="in2" type="VDF" value="" doc="Second VDF." />
<output name="out" type="VDF" />
</nodedef>
<!--
Node: <multiply>
-->
<nodedef name="ND_multiply_bsdfC" node="multiply" nodegroup="pbr" defaultinput="in1" doc="A node for adjusting the contribution of a BSDF with a weight.">
<input name="in1" type="BSDF" value="" doc="The BSDF to scale." />
<input name="in2" type="color3" value="1.0, 1.0, 1.0" doc="Scaling weight." />
<output name="out" type="BSDF" />
</nodedef>
<nodedef name="ND_multiply_bsdfF" node="multiply" nodegroup="pbr" defaultinput="in1" doc="A node for adjusting the contribution of a BSDF with a weight.">
<input name="in1" type="BSDF" value="" doc="The BSDF to scale." />
<input name="in2" type="float" value="1.0" doc="Scaling weight." />
<output name="out" type="BSDF" />
</nodedef>
<nodedef name="ND_multiply_edfC" node="multiply" nodegroup="pbr" defaultinput="in1" doc="A node for adjusting the contribution of an EDF with a weight.">
<input name="in1" type="EDF" value="" doc="The EDF to scale." />
<input name="in2" type="color3" value="1.0, 1.0, 1.0" doc="Scaling weight." />
<output name="out" type="EDF" />
</nodedef>
<nodedef name="ND_multiply_edfF" node="multiply" nodegroup="pbr" defaultinput="in1" doc="A node for adjusting the contribution of an EDF with a weight.">
<input name="in1" type="EDF" value="" doc="The EDF to scale." />
<input name="in2" type="float" value="1.0" doc="Scaling weight." />
<output name="out" type="EDF" />
</nodedef>
<nodedef name="ND_multiply_vdfC" node="multiply" nodegroup="pbr" defaultinput="in1" doc="A node for adjusting the contribution of an VDF with a weight.">
<input name="in1" type="VDF" value="" doc="The VDF to scale." />
<input name="in2" type="color3" value="1.0, 1.0, 1.0" doc="Scaling weight." />
<output name="out" type="VDF" />
</nodedef>
<nodedef name="ND_multiply_vdfF" node="multiply" nodegroup="pbr" defaultinput="in1" doc="A node for adjusting the contribution of an VDF with a weight.">
<input name="in1" type="VDF" value="" doc="The VDF to scale." />
<input name="in2" type="float" value="1.0" doc="Scaling weight." />
<output name="out" type="VDF" />
</nodedef>
<!--
Node: <roughness_anisotropy>
Calculates anisotropic surface roughness from a scalar roughness and anisotropy parameterization.
-->
<nodedef name="ND_roughness_anisotropy" node="roughness_anisotropy" nodegroup="pbr" doc="Calculates anisotropic surface roughness from a scalar roughness/anisotropy parameterization.">
<input name="roughness" type="float" value="0.0" />
<input name="anisotropy" type="float" value="0.0" />
<output name="out" type="vector2" />
</nodedef>
<!--
Node: <roughness_dual>
Calculates anisotropic surface roughness from a dual surface roughness parameterization.
-->
<nodedef name="ND_roughness_dual" node="roughness_dual" nodegroup="pbr" doc="Calculates anisotropic surface roughness from a dual surface roughness parameterization.">
<input name="roughness" type="vector2" value="0.0, 0.0" />
<output name="out" type="vector2" />
</nodedef>
<!--
Node: <glossiness_anisotropy>
Calculates anisotropic surface roughness from a scalar glossiness and anisotropy parameterization.
-->
<nodedef name="ND_glossiness_anisotropy" node="glossiness_anisotropy" nodegroup="pbr" doc="Calculates anisotropic surface roughness from a scalar glossiness/anisotropy parameterization.">
<input name="glossiness" type="float" value="1.0" uimin="0.0" uimax="1.0" />
<input name="anisotropy" type="float" value="0.0" uimin="0.0" uimax="1.0" />
<output name="out" type="vector2" />
</nodedef>
<nodedef name="ND_blackbody" node="blackbody" nodegroup="pbr" doc="Returns the radiant emittance of a blackbody radiator with the given temperature.">
<input name="temperature" type="float" value="5000.0" />
<output name="out" type="float" />
</nodedef>
<!--
Node: <artistic_ior>
Converts the artistic parameterization reflectivity and edge_color to complex IOR values.
-->
<nodedef name="ND_artistic_ior" node="artistic_ior" nodegroup="pbr" doc="Converts the artistic parameterization reflectivity and edge_color to complex IOR values.">
<input name="reflectivity" type="color3" value="0.944, 0.776, 0.373" colorspace="lin_rec709" />
<input name="edge_color" type="color3" value="0.998, 0.981, 0.751" colorspace="lin_rec709" />
<output name="ior" type="color3" />
<output name="extinction" type="color3" />
</nodedef>
</materialx>