forked from AcademySoftwareFoundation/OpenPBR
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopen_pbr_surface.mtlx
More file actions
551 lines (532 loc) · 34.2 KB
/
open_pbr_surface.mtlx
File metadata and controls
551 lines (532 loc) · 34.2 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
<?xml version="1.0"?>
<materialx version="1.38">
<!--
OpenPBR Surface node definition
-->
<nodedef name="ND_open_pbr_surface_surfaceshader" node="open_pbr_surface" nodegroup="pbr" version="0.2" isdefaultversion="true"
doc="OpenPBR Surface Shading Model">
<input name="base_weight" type="float" value="1.0" uimin="0.0" uimax="1.0" uiname="Base Weight" uifolder="Base"
doc="Multiplier on the intensity of the reflection from the diffuse and metallic base." />
<input name="base_color" type="color3" value="0.8, 0.8, 0.8" uimin="0,0,0" uimax="1,1,1" uiname="Base Color" uifolder="Base"
doc="Color of the reflection from the diffuse and metallic base." />
<input name="base_roughness" type="float" value="0.0" uimin="0.0" uimax="1.0" uiname="Base Roughness" uifolder="Base" uiadvanced="true"
doc="Roughness of the diffuse reflection. Higher values cause the surface to appear flatter." />
<input name="base_metalness" type="float" value="0.0" uimin="0.0" uimax="1.0" uiname="Base Metalness" uifolder="Base"
doc="Specifies how metallic the base material appears (dials the base from pure dielectric to pure metal)." />
<input name="specular_weight" type="float" value="1.0" uimin="0.0" uimax="1.0" uiname="Specular Weight" uifolder="Specular"
doc="Multiplier on the intensity of the specular reflection." />
<input name="specular_color" type="color3" value="1, 1, 1" uimin="0,0,0" uimax="1,1,1" uiname="Specular Color" uifolder="Specular"
doc="Color of the specular reflection (controls the physical edge-tint for metals, and a non-physical overall tint for dielectrics)." />
<input name="specular_roughness" type="float" value="0.3" uimin="0.0" uimax="1.0" uiname="Specular Roughness" uifolder="Specular"
doc="The roughness of the specular reflection. Lower numbers produce sharper reflections, higher numbers produce blurrier reflections." />
<input name="specular_ior" type="float" value="1.5" uimin="0.0" uisoftmin="1.0" uisoftmax="3.0" uiname="Specular Index of Refraction" uifolder="Specular"
doc="Index of refraction of the dielectric base." />
<input name="specular_ior_level" type="float" value="0.5" uimin="0.0" uimax="1.0" uiname="Specular IOR Level" uifolder="Specular"
doc="Modulates the dielectric reflectivity at normal incidence between zero and double the original." />
<input name="specular_anisotropy" type="float" value="0.0" uimin="0.0" uimax="1.0" uiname="Specular Anisotropy" uifolder="Specular" uiadvanced="true"
doc="The directional bias of the roughness of the metal/dielectric base, resulting in increasingly stretched highlights along the tangent direction." />
<input name="specular_rotation" type="float" value="0.0" uimin="0.0" uimax="1.0" uiname="Specular Rotation" uifolder="Specular" uiadvanced="true"
doc="Rotation of the axis of specular roughness anisotropy around the surface normal." />
<input name="transmission_weight" type="float" value="0.0" uimin="0.0" uimax="1.0" uiname="Transmission Weight" uifolder="Transmission" uiadvanced="true"
doc="Mixture weight between the transparent and opaque dielectric base. The greater the value the more transparent the material." />
<input name="transmission_color" type="color3" value="1, 1, 1" uimin="0,0,0" uimax="1,1,1" uiname="Transmission Color" uifolder="Transmission" uiadvanced="true"
doc="Controls color of the transparent base due to Beer's law volumetric absorption under the surface (reverts to a non-physical tint when transmission_depth is zero)." />
<input name="transmission_depth" type="float" value="0.0" uimin="0.0" uisoftmax="1.0" uiname="Transmission Depth" uifolder="Transmission" uiadvanced="true"
doc="Specifies the distance light travels inside the transparent base before it becomes exactly the transmission_color according to Beer's law." />
<input name="transmission_scatter" type="color3" value="0, 0, 0" uimin="0,0,0" uimax="1,1,1" uiname="Transmission Scatter" uifolder="Transmission" uiadvanced="true"
doc="Controls the color of light volumetrically scattered inside the transparent base. Suitable for materials with visually significant scattering such as honey, fruit juice, murky water, opalescent glass, or milky glass." />
<input name="transmission_scatter_anisotropy" type="float" value="0.0" uimin="0.0" uimax="1.0" uiname="Transmission Anisotropy" uifolder="Transmission" uiadvanced="true"
doc="The amount of directional bias, or anisotropy, of the volumetric scattering in the transparent base." />
<input name="transmission_dispersion" type="float" value="0.0" uimin="0.0" uisoftmax="100.0" uiname="Transmission Dispersion" uifolder="Transmission" uiadvanced="true"
doc="Dispersion amount, describing how much the dielectric index of refraction varies across wavelengths." />
<input name="subsurface_weight" type="float" value="0" uimin="0.0" uimax="1.0" uiname="Subsurface" uifolder="Subsurface Weight" uiadvanced="true"
doc="Mixture weight which dials the opaque dielectric base between diffuse reflection and subsurface scattering. A value of 1.0 indicates full subsurface scattering and a value 0 for diffuse reflection only." />
<input name="subsurface_color" type="color3" value="0.8, 0.8, 0.8" uimin="0,0,0" uimax="1,1,1" uiname="Subsurface Color" uifolder="Subsurface" uiadvanced="true"
doc="The overall reflected color of the subsurface scattering effect." />
<input name="subsurface_radius" type="float" value="1.0" uimin="0.0" uisoftmax="1.0" uiname="Subsurface Radius" uifolder="Subsurface" uiadvanced="true"
doc="Length scale of the subsurface diffusion blur profile on the surface." />
<input name="subsurface_radius_scale" type="color3" value="1.0, 0.5, 0.25" uimin="0,0,0" uimax="1,1,1" uiname="Subsurface Radius Scale" uifolder="Subsurface" uiadvanced="true"
doc="RGB multiplier to subsurface_radius, giving the per-channel diffusion blur profile size." />
<input name="subsurface_anisotropy" type="float" value="0.0" uimin="-1.0" uimax="1.0" uiname="Subsurface Anisotropy" uifolder="Subsurface" uiadvanced="true"
doc="Controls the phase-function of subsurface scattering, where zero scatters light evenly, positive values scatter forward, and negative values scatter backward." />
<input name="fuzz_weight" type="float" value="0.0" uimin="0.0" uimax="1.0" uiname="Fuzz Weight" uifolder="Fuzz" uiadvanced="true"
doc="The weight of a fuzz layer that can be used to approximate microfibers, for fabrics such as velvet and satin as well as dust grains." />
<input name="fuzz_color" type="color3" value="1, 1, 1" uimin="0,0,0" uimax="1,1,1" uiname="Fuzz Color" uifolder="Fuzz" uiadvanced="true"
doc="The color of the fuzz layer." />
<input name="fuzz_roughness" type="float" value="0.5" uimin="0.0" uimax="1.0" uiname="Fuzz Roughness" uifolder="Fuzz" uiadvanced="true"
doc="The roughness of the fuzz layer." />
<input name="coat_weight" type="float" value="0.0" uimin="0.0" uimax="1.0" uiname="Coat Weight" uifolder="Coat"
doc="The weight of a reflective clear-coat layer on top of the material. Use for materials such as car paint or an oily layer." />
<input name="coat_color" type="color3" value="1, 1, 1" uimin="0,0,0" uimax="1,1,1" uiname="Coat Color" uifolder="Coat"
doc="The color of the clear-coat layer's transparency, due to absorption in the coat." />
<input name="coat_roughness" type="float" value="0.0" uimin="0.0" uimax="1.0" uiname="Coat Roughness" uifolder="Coat"
doc="The roughness of the clear-coat reflections. The lower the value, the sharper the reflection." />
<input name="coat_anisotropy" type="float" value="0.0" uimin="0.0" uimax="1.0" uiname="Coat Anisotropy" uifolder="Coat" uiadvanced="true"
doc="The directional bias of the roughness of the clear-coat layer, resulting in increasingly stretched highlights along the coat tangent direction." />
<input name="coat_rotation" type="float" value="0.0" uimin="0.0" uimax="1.0" uiname="Coat Rotation" uifolder="Coat" uiadvanced="true"
doc="Rotation of the axis of clear-coat roughness anisotropy around the coat normal." />
<input name="coat_ior" type="float" value="1.6" uimin="0.0" uisoftmin="1.0" uisoftmax="3.0" uiname="Coat Index of Refraction" uifolder="Coat"
doc="The index of refraction of the clear-coat layer." />
<input name="coat_ior_level" type="float" value="0.5" uimin="0.0" uimax="1.0" uiname="Coat IOR Level" uifolder="Specular"
doc="Modulates the clear-coat reflectivity at normal incidence between zero and double the original." />
<input name="thin_film_thickness" type="float" value="0" uimin="0.0" uisoftmax="2000.0" uiname="Thin Film Thickness" uifolder="Thin Film" uiadvanced="true"
doc="The thickness of the thin film layer on the base (in nanometers). Use for materials such as multi-tone car paint or soap bubbles." />
<input name="thin_film_ior" type="float" value="1.5" uimin="0.0" uisoftmin="1.0" uisoftmax="3.0" uiname="Thin Film Index of Refraction" uifolder="Thin Film" uiadvanced="true"
doc="The index of refraction of the thin-film." />
<input name="emission_luminance" type="float" value="0.0" uimin="0.0" uisoftmax="1000.0" uiname="Emission Luminance" uifolder="Emission"
doc="The amount of emitted light, as a luminance in nits." />
<input name="emission_color" type="color3" value="1, 1, 1" uimin="0,0,0" uimax="1,1,1" uiname="Emission Color" uifolder="Emission"
doc="The color of the emitted light." />
<input name="geometry_opacity" type="color3" value="1, 1, 1" uimin="0,0,0" uimax="1,1,1" uiname="Opacity" uifolder="Geometry"
doc="The opacity of the entire material." />
<input name="geometry_thin_walled" type="boolean" value="false" uiname="Thin Walled" uifolder="Geometry" uiadvanced="true"
doc="If true the surface is double-sided and represents an infinitesimally thin shell. Suitable for extremely geometrically thin objects such as leaves or paper." />
<input name="geometry_normal" type="vector3" defaultgeomprop="Nworld" uiname="Normal" uifolder="Geometry"
doc="Input geometric normal" />
<input name="geometry_coat_normal" type="vector3" defaultgeomprop="Nworld" uiname="Coat Normal" uifolder="Geometry"
doc="Input normal for clear-coat layer" />
<input name="geometry_tangent" type="vector3" defaultgeomprop="Tworld" uiname="Tangent Input" uifolder="Geometry"
doc="Input geometric tangent" />
<output name="out" type="surfaceshader" />
</nodedef>
<!--
OpenPBR Surface graph definition
-->
<nodegraph name="NG_open_pbr_surface_surfaceshader" nodedef="ND_open_pbr_surface_surfaceshader">
<!-- Roughness influence by coat-->
<!-- Calculate main specular roughness -->
<multiply name="coat_affect_roughness_multiply1" type="float">
<input name="in1" type="float" value="1.0" />
<input name="in2" type="float" interfacename="coat_weight" />
</multiply>
<multiply name="coat_affect_roughness_multiply2" type="float">
<input name="in1" type="float" nodename="coat_affect_roughness_multiply1" />
<input name="in2" type="float" interfacename="coat_roughness" />
</multiply>
<mix name="coat_affected_roughness" type="float">
<input name="fg" type="float" value="1.0" />
<input name="bg" type="float" interfacename="specular_roughness" />
<input name="mix" type="float" nodename="coat_affect_roughness_multiply2" />
</mix>
<roughness_anisotropy name="main_roughness" type="vector2">
<input name="roughness" type="float" nodename="coat_affected_roughness" />
<input name="anisotropy" type="float" interfacename="specular_anisotropy" />
</roughness_anisotropy>
<!-- Calculate transmission roughness -->
<clamp name="transmission_roughness_clamped" type="float">
<input name="in" type="float" interfacename="specular_roughness" />
</clamp>
<mix name="coat_affected_transmission_roughness" type="float">
<input name="fg" type="float" value="1.0" />
<input name="bg" type="float" nodename="transmission_roughness_clamped" />
<input name="mix" type="float" nodename="coat_affect_roughness_multiply2" />
</mix>
<roughness_anisotropy name="transmission_roughness" type="vector2">
<input name="roughness" type="float" nodename="coat_affected_transmission_roughness" />
<input name="anisotropy" type="float" interfacename="specular_anisotropy" />
</roughness_anisotropy>
<!-- Tangent rotation -->
<multiply name="tangent_rotate_degree" type="float">
<input name="in1" type="float" interfacename="specular_rotation" />
<input name="in2" type="float" value="360" />
</multiply>
<rotate3d name="tangent_rotate" type="vector3">
<input name="in" type="vector3" interfacename="geometry_tangent" />
<input name="amount" type="float" nodename="tangent_rotate_degree" />
<input name="axis" type="vector3" interfacename="geometry_normal" />
</rotate3d>
<normalize name="tangent_rotate_normalize" type="vector3">
<input name="in" type="vector3" nodename="tangent_rotate" />
</normalize>
<ifgreater name="main_tangent" type="vector3">
<input name="value1" type="float" interfacename="specular_anisotropy" />
<input name="value2" type="float" value="0.0" />
<input name="in1" type="vector3" nodename="tangent_rotate_normalize" />
<input name="in2" type="vector3" interfacename="geometry_tangent" />
</ifgreater>
<!-- Coat tangent rotation -->
<multiply name="coat_tangent_rotate_degree" type="float">
<input name="in1" type="float" interfacename="coat_rotation" />
<input name="in2" type="float" value="360" />
</multiply>
<rotate3d name="coat_tangent_rotate" type="vector3">
<input name="in" type="vector3" interfacename="geometry_tangent" />
<input name="amount" type="float" nodename="coat_tangent_rotate_degree" />
<input name="axis" type="vector3" interfacename="geometry_coat_normal" />
</rotate3d>
<normalize name="coat_tangent_rotate_normalize" type="vector3">
<input name="in" type="vector3" nodename="coat_tangent_rotate" />
</normalize>
<ifgreater name="coat_tangent" type="vector3">
<input name="value1" type="float" interfacename="coat_anisotropy" />
<input name="value2" type="float" value="0.0" />
<input name="in1" type="vector3" nodename="coat_tangent_rotate_normalize" />
<input name="in2" type="vector3" interfacename="geometry_tangent" />
</ifgreater>
<!-- Colors influenced by coat ("coat gamma") -->
<clamp name="coat_clamped" type="float">
<input name="in" type="float" interfacename="coat_weight" />
</clamp>
<multiply name="coat_gamma_multiply" type="float">
<input name="in1" type="float" nodename="coat_clamped" />
<input name="in2" type="float" value="1.0" />
</multiply>
<add name="coat_gamma" type="float">
<input name="in1" type="float" nodename="coat_gamma_multiply" />
<input name="in2" type="float" value="1.0" />
</add>
<max name="base_color_nonnegative" type="color3">
<input name="in1" type="color3" interfacename="base_color" />
<input name="in2" type="float" value="0.0" />
</max>
<power name="coat_affected_diffuse_color" type="color3">
<input name="in1" type="color3" nodename="base_color_nonnegative" />
<input name="in2" type="float" nodename="coat_gamma" />
</power>
<max name="subsurface_color_nonnegative" type="color3">
<input name="in1" type="color3" interfacename="subsurface_color" />
<input name="in2" type="float" value="0.0" />
</max>
<power name="coat_affected_subsurface_color" type="color3">
<input name="in1" type="color3" nodename="subsurface_color_nonnegative" />
<input name="in2" type="float" nodename="coat_gamma" />
</power>
<!-- Subsurface (thin-walled) -->
<oren_nayar_diffuse_bsdf name="subsurface_thin_walled_reflection_bsdf" type="BSDF">
<input name="weight" type="float" value="1.0" />
<input name="color" type="color3" nodename="coat_affected_subsurface_color" />
<input name="roughness" type="float" interfacename="base_roughness" />
<input name="normal" type="vector3" interfacename="geometry_normal" />
</oren_nayar_diffuse_bsdf>
<subtract name="one_minus_subsurface_anisotropy" type="float">
<input name="in1" type="float" value="1.0" />
<input name="in2" type="float" interfacename="subsurface_anisotropy" />
</subtract>
<multiply name="subsurface_thin_walled_brdf_factor" type="color3">
<input name="in1" type="color3" interfacename="subsurface_color" />
<input name="in2" type="float" nodename="one_minus_subsurface_anisotropy" />
</multiply>
<multiply name="subsurface_thin_walled_reflection" type="BSDF">
<input name="in1" type="BSDF" nodename="subsurface_thin_walled_reflection_bsdf" />
<input name="in2" type="color3" nodename="subsurface_thin_walled_brdf_factor" />
</multiply>
<translucent_bsdf name="subsurface_thin_walled_transmission_bsdf" type="BSDF">
<input name="weight" type="float" value="1.0" />
<input name="color" type="color3" nodename="coat_affected_subsurface_color" />
<input name="normal" type="vector3" interfacename="geometry_normal" />
</translucent_bsdf>
<add name="one_plus_subsurface_anisotropy" type="float">
<input name="in1" type="float" value="1.0" />
<input name="in2" type="float" interfacename="subsurface_anisotropy" />
</add>
<multiply name="subsurface_thin_walled_btdf_factor" type="color3">
<input name="in1" type="color3" interfacename="subsurface_color" />
<input name="in2" type="float" nodename="one_plus_subsurface_anisotropy" />
</multiply>
<multiply name="subsurface_thin_walled_transmission" type="BSDF">
<input name="in1" type="BSDF" nodename="subsurface_thin_walled_transmission_bsdf" />
<input name="in2" type="color3" nodename="subsurface_thin_walled_btdf_factor" />
</multiply>
<mix name="subsurface_thin_walled" type="BSDF">
<input name="fg" type="BSDF" nodename="subsurface_thin_walled_reflection" />
<input name="bg" type="BSDF" nodename="subsurface_thin_walled_transmission" />
<input name="mix" type="float" value="0.5" />
</mix>
<!-- Subsurface (non-thin-walled) -->
<convert name="subsurface_radius_vector" type="vector3">
<input name="in" type="color3" interfacename="subsurface_radius_scale" />
</convert>
<multiply name="subsurface_radius_scaled" type="vector3">
<input name="in1" type="vector3" nodename="subsurface_radius_vector" />
<input name="in2" type="float" interfacename="subsurface_radius" />
</multiply>
<subsurface_bsdf name="subsurface_bsdf" type="BSDF">
<input name="weight" type="float" value="1.0" />
<input name="color" type="color3" nodename="coat_affected_subsurface_color" />
<input name="radius" type="vector3" nodename="subsurface_radius_scaled" />
<input name="anisotropy" type="float" interfacename="subsurface_anisotropy" />
<input name="normal" type="vector3" interfacename="geometry_normal" />
</subsurface_bsdf>
<!-- Opaque Dielectric Base -->
<oren_nayar_diffuse_bsdf name="diffuse_bsdf" type="BSDF">
<input name="weight" type="float" interfacename="base_weight" />
<input name="color" type="color3" nodename="coat_affected_diffuse_color" />
<input name="roughness" type="float" interfacename="base_roughness" />
<input name="normal" type="vector3" interfacename="geometry_normal" />
</oren_nayar_diffuse_bsdf>
<convert name="subsurface_selector" type="float">
<input name="in" type="boolean" interfacename="geometry_thin_walled" />
</convert>
<mix name="selected_subsurface" type="BSDF">
<input name="fg" type="BSDF" nodename="subsurface_thin_walled" />
<input name="bg" type="BSDF" nodename="subsurface_bsdf" />
<input name="mix" type="float" nodename="subsurface_selector" />
</mix>
<mix name="opaque_base" type="BSDF">
<input name="fg" type="BSDF" nodename="selected_subsurface" />
<input name="bg" type="BSDF" nodename="diffuse_bsdf" />
<input name="mix" type="float" interfacename="subsurface_weight" />
</mix>
<!-- Dielectric Base -->
<divide name="specular_to_coat_ior_ratio" type="float">
<input name="in1" type="float" interfacename="specular_ior" />
<input name="in2" type="float" nodename="modulated_coat_ior" />
</divide>
<subtract name="specular_ior_minus_one" type="float">
<input name="in1" type="float" nodename="specular_to_coat_ior_ratio" />
<input name="in2" type="float" value="1.0" />
</subtract>
<add name="specular_ior_plus_one" type="float">
<input name="in1" type="float" value="1.0" />
<input name="in2" type="float" nodename="specular_to_coat_ior_ratio" />
</add>
<divide name="specular_ior_to_F0_sqrt" type="float">
<input name="in1" type="float" nodename="specular_ior_minus_one" />
<input name="in2" type="float" nodename="specular_ior_plus_one" />
</divide>
<multiply name="specular_ior_to_F0" type="float">
<input name="in1" type="float" nodename="specular_ior_to_F0_sqrt" />
<input name="in2" type="float" nodename="specular_ior_to_F0_sqrt" />
</multiply>
<divide name="half_over_specular_F0" type="float">
<input name="in1" type="float" value="0.5" />
<input name="in2" type="float" nodename="specular_ior_to_F0" />
</divide>
<min name="specular_ior_level_upper_bound" type="float">
<input name="in1" type="float" value="1.0" />
<input name="in2" type="float" nodename="half_over_specular_F0" />
</min>
<clamp name="specular_ior_level_clamped" type="float">
<input name="in" type="float" interfacename="specular_ior_level" />
<input name="low" type="float" value="0.0" />
<input name="high" type="float" nodename="specular_ior_level_upper_bound" />
</clamp>
<multiply name="modulated_specular_reflectivity1" type="float">
<input name="in1" type="float" nodename="specular_ior_level_clamped" />
<input name="in2" type="float" nodename="specular_ior_to_F0" />
</multiply>
<multiply name="modulated_specular_reflectivity2" type="float">
<input name="in1" type="float" value="2.0" />
<input name="in2" type="float" nodename="modulated_specular_reflectivity1" />
</multiply>
<sqrt name="sqrt_modulated_specular_reflectivity" type="float">
<input name="in" type="float" nodename="modulated_specular_reflectivity2" />
</sqrt>
<sign name="sign_specular_ior_minus_one" type="float">
<input name="in" type="float" nodename="specular_ior_minus_one" />
</sign>
<multiply name="modulated_specular_reflectivity3" type="float">
<input name="in1" type="float" nodename="sign_specular_ior_minus_one" />
<input name="in2" type="float" nodename="sqrt_modulated_specular_reflectivity" />
</multiply>
<subtract name="one_minus_modulated_specular_reflectivity3" type="float">
<input name="in1" type="float" value="1.0" />
<input name="in2" type="float" nodename="modulated_specular_reflectivity3" />
</subtract>
<add name="one_plus_modulated_specular_reflectivity3" type="float">
<input name="in1" type="float" value="1.0" />
<input name="in2" type="float" nodename="modulated_specular_reflectivity3" />
</add>
<divide name="modulated_specular_ior_ratio" type="float">
<input name="in1" type="float" nodename="one_plus_modulated_specular_reflectivity3" />
<input name="in2" type="float" nodename="one_minus_modulated_specular_reflectivity3" />
</divide>
<dielectric_bsdf name="dielectric_transmission" type="BSDF">
<input name="weight" type="float" value="1.0" />
<input name="tint" type="color3" interfacename="transmission_color" />
<input name="ior" type="float" nodename="modulated_specular_ior_ratio" />
<input name="roughness" type="vector2" nodename="transmission_roughness" />
<input name="normal" type="vector3" interfacename="geometry_normal" />
<input name="tangent" type="vector3" nodename="main_tangent" />
<input name="distribution" type="string" value="ggx" />
<input name="scatter_mode" type="string" value="T" />
</dielectric_bsdf>
<mix name="dielectric_substrate" type="BSDF">
<input name="fg" type="BSDF" nodename="dielectric_transmission" />
<input name="bg" type="BSDF" nodename="opaque_base" />
<input name="mix" type="float" interfacename="transmission_weight" />
</mix>
<dielectric_bsdf name="dielectric_reflection" type="BSDF">
<input name="weight" type="float" interfacename="specular_weight" />
<input name="tint" type="color3" interfacename="specular_color" />
<input name="ior" type="float" nodename="modulated_specular_ior_ratio" />
<input name="roughness" type="vector2" nodename="main_roughness" />
<input name="normal" type="vector3" interfacename="geometry_normal" />
<input name="tangent" type="vector3" nodename="main_tangent" />
<input name="distribution" type="string" value="ggx" />
<input name="scatter_mode" type="string" value="R" />
</dielectric_bsdf>
<layer name="dielectric_base" type="BSDF">
<input name="top" type="BSDF" nodename="dielectric_reflection" />
<input name="base" type="BSDF" nodename="dielectric_substrate" />
</layer>
<!-- Metal Layer -->
<multiply name="metal_reflectivity" type="color3">
<input name="in1" type="color3" interfacename="base_color" />
<input name="in2" type="float" interfacename="base_weight" />
</multiply>
<multiply name="metal_edgecolor" type="color3">
<input name="in1" type="color3" interfacename="specular_color" />
<input name="in2" type="float" interfacename="specular_weight" />
</multiply>
<!-- TODO: Add support for a color82 input in generalized_schlick_bsdf -->
<generalized_schlick_bsdf name="metal_bsdf" type="BSDF">
<input name="weight" type="float" value="1.0" />
<input name="color0" type="color3" nodename="metal_reflectivity" />
<input name="color90" type="color3" nodename="metal_edgecolor" />
<input name="roughness" type="vector2" nodename="main_roughness" />
<input name="normal" type="vector3" interfacename="geometry_normal" />
<input name="tangent" type="vector3" nodename="main_tangent" />
</generalized_schlick_bsdf>
<mix name="base_substrate" type="BSDF">
<input name="fg" type="BSDF" nodename="metal_bsdf" />
<input name="bg" type="BSDF" nodename="dielectric_base" />
<input name="mix" type="float" interfacename="base_metalness" />
</mix>
<!-- Thin-film Layer -->
<thin_film_bsdf name="thin_film_bsdf" type="BSDF">
<input name="thickness" type="float" interfacename="thin_film_thickness" />
<input name="ior" type="float" interfacename="thin_film_ior" />
</thin_film_bsdf>
<layer name="thin_film_layer" type="BSDF">
<input name="top" type="BSDF" nodename="thin_film_bsdf" />
<input name="base" type="BSDF" nodename="base_substrate" />
</layer>
<!-- Coat Layer -->
<divide name="half_over_coat_F0" type="float">
<input name="in1" type="float" value="0.5" />
<input name="in2" type="float" nodename="coat_ior_to_F0" />
</divide>
<min name="coat_ior_level_upper_bound" type="float">
<input name="in1" type="float" value="1.0" />
<input name="in2" type="float" nodename="half_over_coat_F0" />
</min>
<clamp name="coat_ior_level_clamped" type="float">
<input name="in" type="float" interfacename="coat_ior_level" />
<input name="low" type="float" value="0.0" />
<input name="high" type="float" nodename="coat_ior_level_upper_bound" />
</clamp>
<multiply name="modulated_coat_reflectivity1" type="float">
<input name="in1" type="float" nodename="coat_ior_level_clamped" />
<input name="in2" type="float" nodename="coat_ior_to_F0" />
</multiply>
<multiply name="modulated_coat_reflectivity2" type="float">
<input name="in1" type="float" value="2.0" />
<input name="in2" type="float" nodename="modulated_coat_reflectivity1" />
</multiply>
<sqrt name="sqrt_modulated_coat_reflectivity" type="float">
<input name="in" type="float" nodename="modulated_coat_reflectivity2" />
</sqrt>
<subtract name="one_minus_sqrt_modulated_coat_reflectivity" type="float">
<input name="in1" type="float" value="1.0" />
<input name="in2" type="float" nodename="sqrt_modulated_coat_reflectivity" />
</subtract>
<add name="one_plus_sqrt_modulated_coat_reflectivity" type="float">
<input name="in1" type="float" value="1.0" />
<input name="in2" type="float" nodename="sqrt_modulated_coat_reflectivity" />
</add>
<divide name="modulated_coat_ior_ratio" type="float">
<input name="in1" type="float" nodename="one_plus_sqrt_modulated_coat_reflectivity" />
<input name="in2" type="float" nodename="one_minus_sqrt_modulated_coat_reflectivity" />
</divide>
<mix name="modulated_coat_ior" type="float">
<input name="fg" type="float" nodename="modulated_coat_ior_ratio" />
<input name="bg" type="float" value="1.0" />
<input name="mix" type="float" interfacename="coat_weight" />
</mix>
<mix name="coat_attenuation" type="color3">
<input name="fg" type="color3" interfacename="coat_color" />
<input name="bg" type="color3" value="1.0, 1.0, 1.0" />
<input name="mix" type="float" interfacename="coat_weight" />
</mix>
<multiply name="coat_substrate_attenuated" type="BSDF">
<input name="in1" type="BSDF" nodename="thin_film_layer" />
<input name="in2" type="color3" nodename="coat_attenuation" />
</multiply>
<roughness_anisotropy name="coat_roughness_vector" type="vector2">
<input name="roughness" type="float" interfacename="coat_roughness" />
<input name="anisotropy" type="float" interfacename="coat_anisotropy" />
</roughness_anisotropy>
<dielectric_bsdf name="coat_bsdf" type="BSDF">
<input name="weight" type="float" interfacename="coat_weight" />
<input name="tint" type="color3" value="1.0, 1.0, 1.0" />
<input name="ior" type="float" nodename="modulated_coat_ior" />
<input name="roughness" type="vector2" nodename="coat_roughness_vector" />
<input name="normal" type="vector3" interfacename="geometry_coat_normal" />
<input name="tangent" type="vector3" nodename="coat_tangent" />
<input name="distribution" type="string" value="ggx" />
<input name="scatter_mode" type="string" value="R" />
</dielectric_bsdf>
<layer name="coat_layer" type="BSDF">
<input name="top" type="BSDF" nodename="coat_bsdf" />
<input name="base" type="BSDF" nodename="coat_substrate_attenuated" />
</layer>
<!-- Fuzz Layer -->
<!-- TODO: Add a new BSDF node for the selected fuzz model in OpenPBR -->
<sheen_bsdf name="fuzz_bsdf" type="BSDF">
<input name="weight" type="float" interfacename="fuzz_weight" />
<input name="color" type="color3" interfacename="fuzz_color" />
<input name="roughness" type="float" interfacename="fuzz_roughness" />
<input name="normal" type="vector3" interfacename="geometry_normal" />
</sheen_bsdf>
<layer name="fuzz_layer" type="BSDF">
<input name="top" type="BSDF" nodename="fuzz_bsdf" />
<input name="base" type="BSDF" nodename="coat_layer" />
</layer>
<!-- Emission Layer -->
<subtract name="coat_ior_minus_one" type="float">
<input name="in1" type="float" interfacename="coat_ior" />
<input name="in2" type="float" value="1.0" />
</subtract>
<add name="coat_ior_plus_one" type="float">
<input name="in1" type="float" value="1.0" />
<input name="in2" type="float" interfacename="coat_ior" />
</add>
<divide name="coat_ior_to_F0_sqrt" type="float">
<input name="in1" type="float" nodename="coat_ior_minus_one" />
<input name="in2" type="float" nodename="coat_ior_plus_one" />
</divide>
<multiply name="coat_ior_to_F0" type="float">
<input name="in1" type="float" nodename="coat_ior_to_F0_sqrt" />
<input name="in2" type="float" nodename="coat_ior_to_F0_sqrt" />
</multiply>
<multiply name="emission_weight" type="color3">
<input name="in1" type="color3" interfacename="emission_color" />
<input name="in2" type="float" interfacename="emission_luminance" />
</multiply>
<uniform_edf name="uncoated_emission_edf" type="EDF">
<input name="color" type="color3" nodename="emission_weight" />
</uniform_edf>
<multiply name="coat_tinted_emission_edf" type="EDF">
<input name="in1" type="EDF" nodename="uncoated_emission_edf" />
<input name="in2" type="color3" interfacename="coat_color" />
</multiply>
<subtract name="one_minus_coat_F0" type="float">
<input name="in1" type="float" value="1.0" />
<input name="in2" type="float" nodename="coat_ior_to_F0" />
</subtract>
<generalized_schlick_edf name="coated_emission_edf" type="EDF">
<input name="color0" type="color3" nodename="one_minus_coat_F0" channels="rrr" />
<input name="color90" type="color3" value="0.0, 0.0, 0.0" />
<input name="exponent" type="float" value="5.0" />
<input name="base" type="EDF" nodename="coat_tinted_emission_edf" />
</generalized_schlick_edf>
<mix name="emission_edf" type="EDF">
<input name="fg" type="EDF" nodename="coated_emission_edf" />
<input name="bg" type="EDF" nodename="uncoated_emission_edf" />
<input name="mix" type="float" interfacename="coat_weight" />
</mix>
<!-- Surface construction with opacity -->
<!-- Node <surface> only supports monochromatic opacity so use the luminance of input opacity color -->
<luminance name="opacity_luminance" type="color3">
<input name="in" type="color3" interfacename="geometry_opacity" />
</luminance>
<surface name="shader_constructor" type="surfaceshader">
<input name="bsdf" type="BSDF" nodename="fuzz_layer" />
<input name="edf" type="EDF" nodename="emission_edf" />
<input name="opacity" type="float" nodename="opacity_luminance" channels="r" />
</surface>
<!-- Output -->
<output name="out" type="surfaceshader" nodename="shader_constructor" />
</nodegraph>
</materialx>