forked from google/filament
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMaterials.html
3067 lines (2304 loc) · 231 KB
/
Materials.html
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
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<html><head><meta charset="utf-8">
<style>img { max-width: 100%; }</style>
</head><body style="visibility: visible;" id="md"><meta charset="UTF-8"><meta http-equiv="content-type" content="text/html;charset=UTF-8"><meta name="viewport" content="width=600, initial-scale=1"><style>body{max-width:680px;margin:auto;padding:20px;text-align:justify;line-height:140%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-smoothing:antialiased;color:#222;font-family:Palatino,Georgia,"Times New Roman",serif}</style><style>@media print{*{-webkit-print-color-adjust:exact;text-shadow:none !important}}body{counter-reset: h1 paragraph line item list-item}@page{margin:0;size:auto}#mdContextMenu{position:absolute;background:#383838;cursor:default;border:1px solid #999;color:#fff;padding:4px 0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,"Helvetica Neue",sans-serif;font-size:85%;font-weight:600;border-radius:4px;box-shadow:0px 3px 10px rgba(0,0,0,35%)}#mdContextMenu div{padding:0px 20px}#mdContextMenu div:hover{background:#1659d1}.md code,.md pre{font-family:Menlo,Consolas,monospace;font-size:85%;text-align:left;line-height:140%}.md .mediumToc code,.md longToc code,.md .shortToc code,.md h1 code,.md h2 code,.md h3 code,.md h4 code,.md h5 code,.md h6 code{font-size:unset}.md div.title{font-size:26px;font-weight:800;line-height:120%;text-align:center}.md div.afterTitles{height:10px}.md div.subtitle{text-align:center}.md iframe.textinsert, .md object.textinsert,.md iframe:not(.markdeep){display:block;margin-top:10px;margin-bottom:10px;width:100%;height:75vh;border:1px solid #000;border-radius:4px;background:#f5f5f4}.md .image{display:inline-block}.md img{max-width:100%;page-break-inside:avoid}.md li{text-align:left;text-indent:0}.md pre.listing {width:100%;tab-size:4;-moz-tab-size:4;-o-tab-size:4;counter-reset:line;overflow-x:auto;resize:horizontal}.md pre.listing .linenumbers span.line:before{width:30px;margin-left:-28px;font-size:80%;text-align:right;counter-increment:line;content:counter(line);display:inline-block;padding-right:13px;margin-right:8px;color:#ccc}.md div.tilde{margin:20px 0 -10px;text-align:center}.md .imagecaption,.md .tablecaption,.md .listingcaption{display:inline-block;margin:7px 5px 12px;text-align:justify;font-style:italic}.md img.pixel{image-rendering:-moz-crisp-edges;image-rendering:pixelated}.md blockquote.fancyquote{margin:25px 0 25px;text-align:left;line-height:160%}.md blockquote.fancyquote::before{content:"“";color:#DDD;font-family:Times New Roman;font-size:45px;line-height:0;margin-right:6px;vertical-align:-0.3em}.md span.fancyquote{font-size:118%;color:#777;font-style:italic}.md span.fancyquote::after{content:"”";font-style:normal;color:#DDD;font-family:Times New Roman;font-size:45px;line-height:0;margin-left:6px;vertical-align:-0.3em}.md blockquote.fancyquote .author{width:100%;margin-top:10px;display:inline-block;text-align:right}.md small{font-size:60%}.md big{font-size:150%}.md div.title,contents,.md .tocHeader,.md h1,.md h2,.md h3,.md h4,.md h5,.md h6,.md .shortTOC,.md .mediumTOC,.nonumberh1,.nonumberh2,.nonumberh3,.nonumberh4,.nonumberh5,.nonumberh6{font-family:Verdana,Helvetica,Arial,sans-serif;margin:13.4px 0 13.4px;padding:15px 0 3px;border-top:none;clear:both}.md .tocTop {display:none}.md h1,.md h2,.md h3,.md h4,.md h5,.md h6,.md .nonumberh1,.md .nonumberh2,.md .nonumberh3,.md .nonumberh4,.md .nonumberh5,.md .nonumberh6{page-break-after:avoid;break-after:avoid}.md svg.diagram{display:block;font-family:Menlo,Consolas,monospace;font-size:85%;text-align:center;stroke-linecap:round;stroke-width:2px;page-break-inside:avoid;stroke:#000;fill:#000}.md svg.diagram .opendot{fill:#fff}.md svg.diagram .shadeddot{fill:#CCC}.md svg.diagram .dotteddot{stroke:#000;stroke-dasharray:4;fill:none}.md svg.diagram text{stroke:none}@media print{@page{margin:1in 5mm;transform: scale(150%)}}@media print{.md .pagebreak{page-break-after:always;visibility:hidden}}.md a{font-family:Georgia,Palatino,'Times New Roman'}.md h1,.md .tocHeader,.md .nonumberh1{border-bottom:3px solid;font-size:20px;font-weight:bold;}.md h1,.md .nonumberh1{counter-reset:h2 h3 h4 h5 h6}.md h2,.md .nonumberh2{counter-reset:h3 h4 h5 h6;border-bottom:2px solid #999;color:#555;font-weight:bold;font-size:18px;}.md h3,.md h4,.md h5,.md h6,.md .nonumberh3,.md .nonumberh4,.md .nonumberh5,.md .nonumberh6{font-family:Verdana,Helvetica,Arial,sans-serif;color:#555;font-size:16px;}.md h3{counter-reset:h4 h5 h6}.md h4{counter-reset:h5 h6}.md h5{counter-reset:h6}.md div.table{margin:16px 0 16px 0}.md table{border-collapse:collapse;line-height:140%;page-break-inside:avoid}.md table.table{margin:auto}.md table.calendar{width:100%;margin:auto;font-size:11px;font-family:Verdana,Helvetica,Arial,sans-serif}.md table.calendar th{font-size:16px}.md .today{background:#ECF8FA}.md .calendar .parenthesized{color:#999;font-style:italic}.md table.table th{color:#FFF;background-color:#AAA;border:1px solid #888;padding:8px 15px 8px 15px}.md table.table td{padding:5px 15px 5px 15px;border:1px solid #888}.md table.table tr:nth-child(even){background:#EEE}.md pre.tilde{border-top: 1px solid #CCC;border-bottom: 1px solid #CCC;padding: 5px 0 5px 20px;margin:0 0 0 0;background:#FCFCFC;page-break-inside:avoid}.md a.target{width:0px;height:0px;visibility:hidden;font-size:0px;display:inline-block}.md a:link, .md a:visited{color:#38A;text-decoration:none}.md a:link:hover{text-decoration:underline}.md dt{font-weight:700}.md dl>dd{margin-top:-8px; margin-bottom:8px}.md dl>table{margin:35px 0 30px}.md code{page-break-inside:avoid;} @media print{.md .listing code{white-space:pre-wrap}}.md .endnote{font-size:13px;line-height:15px;padding-left:10px;text-indent:-10px}.md .bib{padding-left:80px;text-indent:-80px;text-align:left}.markdeepFooter{font-size:9px;text-align:right;padding-top:80px;color:#999}.md .mediumTOC{float:right;font-size:12px;line-height:15px;border-left:1px solid #CCC;padding-left:15px;margin:15px 0px 15px 25px}.md .mediumTOC .level1{font-weight:600}.md .longTOC .level1{font-weight:600;display:block;padding-top:12px;margin:0 0 -20px}.md .shortTOC{text-align:center;font-weight:bold;margin-top:15px;font-size:14px}.md .admonition{position:relative;margin:1em 0;padding:.4rem 1rem;border-radius:.2rem;border-left:2.5rem solid rgba(68,138,255,.4);background-color:rgba(68,138,255,.15);}.md .admonition-title{font-weight:bold;border-bottom:solid 1px rgba(68,138,255,.4);padding-bottom:4px;margin-bottom:4px;margin-left: -1rem;padding-left:1rem;margin-right:-1rem;border-color:rgba(68,138,255,.4)}.md .admonition.tip{border-left:2.5rem solid rgba(50,255,90,.4);background-color:rgba(50,255,90,.15)}.md .admonition.tip::before{content:"\24d8";font-weight:bold;font-size:150%;position:relative;top:3px;color:rgba(26,128,46,.8);left:-2.95rem;display:block;width:0;height:0}.md .admonition.tip>.admonition-title{border-color:rgba(50,255,90,.4)}.md .admonition.warn,.md .admonition.warning{border-left:2.5rem solid rgba(255,145,0,.4);background-color:rgba(255,145,0,.15)}.md .admonition.warn::before,.md .admonition.warning::before{content:"\26A0";font-weight:bold;font-size:150%;position:relative;top:2px;color:rgba(128,73,0,.8);left:-2.95rem;display:block;width:0;height:0}.md .admonition.warn>.admonition-title,.md .admonition.warning>.admonition-title{border-color:rgba(255,145,0,.4)}.md .admonition.error{border-left: 2.5rem solid rgba(255,23,68,.4);background-color:rgba(255,23,68,.15)}.md .admonition.error>.admonition-title{border-color:rgba(255,23,68,.4)}.md .admonition.error::before{content: "\2612";font-family:"Arial";font-size:200%;position:relative;color:rgba(128,12,34,.8);top:-2px;left:-3rem;display:block;width:0;height:0}.md .admonition p:last-child{margin-bottom:0}.md li.checked,.md li.unchecked{list-style:none;overflow:visible;text-indent:-1.2em}.md li.checked:before,.md li.unchecked:before{content:"\2611";display:block;float:left;width:1em;font-size:120%}.md li.unchecked:before{content:"\2610"}</style><style>.md h1::before {
content:counter(h1) " ";
counter-increment: h1;margin-right:10px}
.md h2::before {
content:counter(h1) "."counter(h2) " ";
counter-increment: h2;margin-right:10px}
.md h3::before {
content:counter(h1) "."counter(h2) "."counter(h3) " ";
counter-increment: h3;margin-right:10px}
.md h4::before {
content:counter(h1) "."counter(h2) "."counter(h3) "."counter(h4) " ";
counter-increment: h4;margin-right:10px}
.md h5::before {
content:counter(h1) "."counter(h2) "."counter(h3) "."counter(h4) "."counter(h5) " ";
counter-increment: h5;margin-right:10px}
.md h6::before {
content:counter(h1) "."counter(h2) "."counter(h3) "."counter(h4) "."counter(h5) "."counter(h6) " ";
counter-increment: h6;margin-right:10px}
</style><style>.hljs{display:block;overflow-x:auto;padding:0.5em;background:#fff;color:#000;-webkit-text-size-adjust:none}.hljs-comment{color:#006a00}.hljs-keyword{color:#02E}.hljs-literal,.nginx .hljs-title{color:#aa0d91}.method,.hljs-list .hljs-title,.hljs-tag .hljs-title,.setting .hljs-value,.hljs-winutils,.tex .hljs-command,.http .hljs-title,.hljs-request,.hljs-status,.hljs-name{color:#008}.hljs-envvar,.tex .hljs-special{color:#660}.hljs-string{color:#c41a16}.hljs-tag .hljs-value,.hljs-cdata,.hljs-filter .hljs-argument,.hljs-attr_selector,.apache .hljs-cbracket,.hljs-date,.hljs-regexp{color:#080}.hljs-sub .hljs-identifier,.hljs-pi,.hljs-tag,.hljs-tag .hljs-keyword,.hljs-decorator,.ini .hljs-title,.hljs-shebang,.hljs-prompt,.hljs-hexcolor,.hljs-rule .hljs-value,.hljs-symbol,.hljs-symbol .hljs-string,.hljs-number,.css .hljs-function,.hljs-function .hljs-title,.coffeescript .hljs-attribute{color:#A0C}.hljs-function .hljs-title{font-weight:bold;color:#000}.hljs-class .hljs-title,.smalltalk .hljs-class,.hljs-type,.hljs-typename,.hljs-tag .hljs-attribute,.hljs-doctype,.hljs-class .hljs-id,.hljs-built_in,.setting,.hljs-params,.clojure .hljs-attribute{color:#5c2699}.hljs-variable{color:#3f6e74}.css .hljs-tag,.hljs-rule .hljs-property,.hljs-pseudo,.hljs-subst{color:#000}.css .hljs-class,.css .hljs-id{color:#9b703f}.hljs-value .hljs-important{color:#ff7700;font-weight:bold}.hljs-rule .hljs-keyword{color:#c5af75}.hljs-annotation,.apache .hljs-sqbracket,.nginx .hljs-built_in{color:#9b859d}.hljs-preprocessor,.hljs-preprocessor *,.hljs-pragma{color:#643820}.tex .hljs-formula{background-color:#eee;font-style:italic}.diff .hljs-header,.hljs-chunk{color:#808080;font-weight:bold}.diff .hljs-change{background-color:#bccff9}.hljs-addition{background-color:#baeeba}.hljs-deletion{background-color:#ffc8bd}.hljs-comment .hljs-doctag{font-weight:bold}.method .hljs-id{color:#000}</style><style>div.title { padding-top: 40px; } div.afterTitles { height: 15px; }</style><meta charset="utf-8">
<style>img { max-width: 100%; }</style>
<script type="text/x-mathjax-config">MathJax.Hub.Config({ TeX: { equationNumbers: {autoNumber: "AMS"} } });</script><span style="display:none">$$\newcommand{\n}{\hat{n}}\newcommand{\thetai}{\theta_\mathrm{i}}\newcommand{\thetao}{\theta_\mathrm{o}}\newcommand{\d}[1]{\mathrm{d}#1}\newcommand{\w}{\hat{\omega}}\newcommand{\wi}{\w_\mathrm{i}}\newcommand{\wo}{\w_\mathrm{o}}\newcommand{\wh}{\w_\mathrm{h}}\newcommand{\Li}{L_\mathrm{i}}\newcommand{\Lo}{L_\mathrm{o}}\newcommand{\Le}{L_\mathrm{e}}\newcommand{\Lr}{L_\mathrm{r}}\newcommand{\Lt}{L_\mathrm{t}}\newcommand{\O}{\mathrm{O}}\newcommand{\degrees}{{^{\large\circ}}}\newcommand{\T}{\mathsf{T}}\newcommand{\mathset}[1]{\mathbb{#1}}\newcommand{\Real}{\mathset{R}}\newcommand{\Integer}{\mathset{Z}}\newcommand{\Boolean}{\mathset{B}}\newcommand{\Complex}{\mathset{C}}\newcommand{\un}[1]{\,\mathrm{#1}}$$
</span>
<span class="md"><p><title>Filament Materials Guide</title></p><div class="title"> Filament Materials Guide </div>
<div class="afterTitles"></div>
<p></p><p>
</p><center><a href="images/filament_logo.png" target="_blank"><img class="markdeep" src="images/filament_logo.png"></a></center>
<p></p>
<div class="longTOC"><div class="tocHeader">Contents</div><p><a href="#" class="tocTop">(Top)</a><br>
<a href="#about" class="level1"><span class="tocNumber">1 </span>About</a><br>
<a href="#about/authors" class="level2"><span class="tocNumber">1.1 </span>Authors</a><br>
<a href="#overview" class="level1"><span class="tocNumber">2 </span>Overview</a><br>
<a href="#overview/coreconcepts" class="level2"><span class="tocNumber">2.1 </span>Core concepts</a><br>
<a href="#materialmodels" class="level1"><span class="tocNumber">3 </span>Material models</a><br>
<a href="#materialmodels/litmodel" class="level2"><span class="tocNumber">3.1 </span>Lit model</a><br>
<a href="#materialmodels/litmodel/basecolor" class="level3"><span class="tocNumber">3.1.1 </span>Base color</a><br>
<a href="#materialmodels/litmodel/metallic" class="level3"><span class="tocNumber">3.1.2 </span>Metallic</a><br>
<a href="#materialmodels/litmodel/roughness" class="level3"><span class="tocNumber">3.1.3 </span>Roughness</a><br>
<a href="#materialmodels/litmodel/non-metals" class="level3"><span class="tocNumber">3.1.4 </span>Non-metals</a><br>
<a href="#materialmodels/litmodel/metals" class="level3"><span class="tocNumber">3.1.5 </span>Metals</a><br>
<a href="#materialmodels/litmodel/refraction" class="level3"><span class="tocNumber">3.1.6 </span>Refraction</a><br>
<a href="#materialmodels/litmodel/reflectance" class="level3"><span class="tocNumber">3.1.7 </span>Reflectance</a><br>
<a href="#materialmodels/litmodel/sheencolor" class="level3"><span class="tocNumber">3.1.8 </span>Sheen color</a><br>
<a href="#materialmodels/litmodel/sheenroughness" class="level3"><span class="tocNumber">3.1.9 </span>Sheen roughness</a><br>
<a href="#materialmodels/litmodel/clearcoat" class="level3"><span class="tocNumber">3.1.10 </span>Clear coat</a><br>
<a href="#materialmodels/litmodel/clearcoatroughness" class="level3"><span class="tocNumber">3.1.11 </span>Clear coat roughness</a><br>
<a href="#materialmodels/litmodel/anisotropy" class="level3"><span class="tocNumber">3.1.12 </span>Anisotropy</a><br>
<a href="#materialmodels/litmodel/anisotropydirection" class="level3"><span class="tocNumber">3.1.13 </span>Anisotropy direction</a><br>
<a href="#materialmodels/litmodel/ambientocclusion" class="level3"><span class="tocNumber">3.1.14 </span>Ambient occlusion</a><br>
<a href="#materialmodels/litmodel/normal" class="level3"><span class="tocNumber">3.1.15 </span>Normal</a><br>
<a href="#materialmodels/litmodel/bentnormal" class="level3"><span class="tocNumber">3.1.16 </span>Bent normal</a><br>
<a href="#materialmodels/litmodel/clearcoatnormal" class="level3"><span class="tocNumber">3.1.17 </span>Clear coat normal</a><br>
<a href="#materialmodels/litmodel/emissive" class="level3"><span class="tocNumber">3.1.18 </span>Emissive</a><br>
<a href="#materialmodels/litmodel/post-lightingcolor" class="level3"><span class="tocNumber">3.1.19 </span>Post-lighting color</a><br>
<a href="#materialmodels/litmodel/indexofrefraction" class="level3"><span class="tocNumber">3.1.20 </span>Index of refraction</a><br>
<a href="#materialmodels/litmodel/transmission" class="level3"><span class="tocNumber">3.1.21 </span>Transmission</a><br>
<a href="#materialmodels/litmodel/absorption" class="level3"><span class="tocNumber">3.1.22 </span>Absorption</a><br>
<a href="#materialmodels/litmodel/micro-thicknessandthickness" class="level3"><span class="tocNumber">3.1.23 </span>Micro-thickness and thickness</a><br>
<a href="#materialmodels/subsurfacemodel" class="level2"><span class="tocNumber">3.2 </span>Subsurface model</a><br>
<a href="#materialmodels/subsurfacemodel/thickness" class="level3"><span class="tocNumber">3.2.1 </span>Thickness</a><br>
<a href="#materialmodels/subsurfacemodel/subsurfacecolor" class="level3"><span class="tocNumber">3.2.2 </span>Subsurface color</a><br>
<a href="#materialmodels/subsurfacemodel/subsurfacepower" class="level3"><span class="tocNumber">3.2.3 </span>Subsurface power</a><br>
<a href="#materialmodels/clothmodel" class="level2"><span class="tocNumber">3.3 </span>Cloth model</a><br>
<a href="#materialmodels/clothmodel/sheencolor" class="level3"><span class="tocNumber">3.3.1 </span>Sheen color</a><br>
<a href="#materialmodels/clothmodel/subsurfacecolor" class="level3"><span class="tocNumber">3.3.2 </span>Subsurface color</a><br>
<a href="#materialmodels/unlitmodel" class="level2"><span class="tocNumber">3.4 </span>Unlit model</a><br>
<a href="#materialmodels/specularglossiness" class="level2"><span class="tocNumber">3.5 </span>Specular glossiness</a><br>
<a href="#materialdefinitions" class="level1"><span class="tocNumber">4 </span>Material definitions</a><br>
<a href="#materialdefinitions/format" class="level2"><span class="tocNumber">4.1 </span>Format</a><br>
<a href="#materialdefinitions/format/differenceswithjson" class="level3"><span class="tocNumber">4.1.1 </span>Differences with JSON</a><br>
<a href="#materialdefinitions/format/example" class="level3"><span class="tocNumber">4.1.2 </span>Example</a><br>
<a href="#materialdefinitions/materialblock" class="level2"><span class="tocNumber">4.2 </span>Material block</a><br>
<a href="#materialdefinitions/materialblock/general:name" class="level3"><span class="tocNumber">4.2.1 </span>General: name</a><br>
<a href="#materialdefinitions/materialblock/general:featurelevel" class="level3"><span class="tocNumber">4.2.2 </span>General: featureLevel</a><br>
<a href="#materialdefinitions/materialblock/general:shadingmodel" class="level3"><span class="tocNumber">4.2.3 </span>General: shadingModel</a><br>
<a href="#materialdefinitions/materialblock/general:parameters" class="level3"><span class="tocNumber">4.2.4 </span>General: parameters</a><br>
<a href="#materialdefinitions/materialblock/general:constants" class="level3"><span class="tocNumber">4.2.5 </span>General: constants</a><br>
<a href="#materialdefinitions/materialblock/general:variantfilter" class="level3"><span class="tocNumber">4.2.6 </span>General: variantFilter</a><br>
<a href="#materialdefinitions/materialblock/general:flipuv" class="level3"><span class="tocNumber">4.2.7 </span>General: flipUV</a><br>
<a href="#materialdefinitions/materialblock/general:quality" class="level3"><span class="tocNumber">4.2.8 </span>General: quality</a><br>
<a href="#materialdefinitions/materialblock/general:instanced" class="level3"><span class="tocNumber">4.2.9 </span>General: instanced</a><br>
<a href="#materialdefinitions/materialblock/general:vertexdomaindevicejittered" class="level3"><span class="tocNumber">4.2.10 </span>General: vertexDomainDeviceJittered</a><br>
<a href="#materialdefinitions/materialblock/vertexandattributes:requires" class="level3"><span class="tocNumber">4.2.11 </span>Vertex and attributes: requires</a><br>
<a href="#materialdefinitions/materialblock/vertexandattributes:variables" class="level3"><span class="tocNumber">4.2.12 </span>Vertex and attributes: variables</a><br>
<a href="#materialdefinitions/materialblock/vertexandattributes:vertexdomain" class="level3"><span class="tocNumber">4.2.13 </span>Vertex and attributes: vertexDomain</a><br>
<a href="#materialdefinitions/materialblock/vertexandattributes:interpolation" class="level3"><span class="tocNumber">4.2.14 </span>Vertex and attributes: interpolation</a><br>
<a href="#materialdefinitions/materialblock/blendingandtransparency:blending" class="level3"><span class="tocNumber">4.2.15 </span>Blending and transparency: blending</a><br>
<a href="#materialdefinitions/materialblock/blendingandtransparency:postlightingblending" class="level3"><span class="tocNumber">4.2.16 </span>Blending and transparency: postLightingBlending</a><br>
<a href="#materialdefinitions/materialblock/blendingandtransparency:transparency" class="level3"><span class="tocNumber">4.2.17 </span>Blending and transparency: transparency</a><br>
<a href="#materialdefinitions/materialblock/blendingandtransparency:maskthreshold" class="level3"><span class="tocNumber">4.2.18 </span>Blending and transparency: maskThreshold</a><br>
<a href="#materialdefinitions/materialblock/blendingandtransparency:refractionmode" class="level3"><span class="tocNumber">4.2.19 </span>Blending and transparency: refractionMode</a><br>
<a href="#materialdefinitions/materialblock/blendingandtransparency:refractiontype" class="level3"><span class="tocNumber">4.2.20 </span>Blending and transparency: refractionType</a><br>
<a href="#materialdefinitions/materialblock/rasterization:culling" class="level3"><span class="tocNumber">4.2.21 </span>Rasterization: culling</a><br>
<a href="#materialdefinitions/materialblock/rasterization:colorwrite" class="level3"><span class="tocNumber">4.2.22 </span>Rasterization: colorWrite</a><br>
<a href="#materialdefinitions/materialblock/rasterization:depthwrite" class="level3"><span class="tocNumber">4.2.23 </span>Rasterization: depthWrite</a><br>
<a href="#materialdefinitions/materialblock/rasterization:depthculling" class="level3"><span class="tocNumber">4.2.24 </span>Rasterization: depthCulling</a><br>
<a href="#materialdefinitions/materialblock/rasterization:doublesided" class="level3"><span class="tocNumber">4.2.25 </span>Rasterization: doubleSided</a><br>
<a href="#materialdefinitions/materialblock/rasterization:alphatocoverage" class="level3"><span class="tocNumber">4.2.26 </span>Rasterization: alphaToCoverage</a><br>
<a href="#materialdefinitions/materialblock/lighting:reflections" class="level3"><span class="tocNumber">4.2.27 </span>Lighting: reflections</a><br>
<a href="#materialdefinitions/materialblock/lighting:shadowmultiplier" class="level3"><span class="tocNumber">4.2.28 </span>Lighting: shadowMultiplier</a><br>
<a href="#materialdefinitions/materialblock/lighting:transparentshadow" class="level3"><span class="tocNumber">4.2.29 </span>Lighting: transparentShadow</a><br>
<a href="#materialdefinitions/materialblock/lighting:clearcoatiorchange" class="level3"><span class="tocNumber">4.2.30 </span>Lighting: clearCoatIorChange</a><br>
<a href="#materialdefinitions/materialblock/lighting:multibounceambientocclusion" class="level3"><span class="tocNumber">4.2.31 </span>Lighting: multiBounceAmbientOcclusion</a><br>
<a href="#materialdefinitions/materialblock/lighting:specularambientocclusion" class="level3"><span class="tocNumber">4.2.32 </span>Lighting: specularAmbientOcclusion</a><br>
<a href="#materialdefinitions/materialblock/anti-aliasing:specularantialiasing" class="level3"><span class="tocNumber">4.2.33 </span>Anti-aliasing: specularAntiAliasing</a><br>
<a href="#materialdefinitions/materialblock/anti-aliasing:specularantialiasingvariance" class="level3"><span class="tocNumber">4.2.34 </span>Anti-aliasing: specularAntiAliasingVariance</a><br>
<a href="#materialdefinitions/materialblock/anti-aliasing:specularantialiasingthreshold" class="level3"><span class="tocNumber">4.2.35 </span>Anti-aliasing: specularAntiAliasingThreshold</a><br>
<a href="#materialdefinitions/materialblock/shading:customsurfaceshading" class="level3"><span class="tocNumber">4.2.36 </span>Shading: customSurfaceShading</a><br>
<a href="#materialdefinitions/vertexblock" class="level2"><span class="tocNumber">4.3 </span>Vertex block</a><br>
<a href="#materialdefinitions/vertexblock/materialvertexinputs" class="level3"><span class="tocNumber">4.3.1 </span>Material vertex inputs</a><br>
<a href="#materialdefinitions/vertexblock/customvertexattributes" class="level3"><span class="tocNumber">4.3.2 </span>Custom vertex attributes</a><br>
<a href="#materialdefinitions/fragmentblock" class="level2"><span class="tocNumber">4.4 </span>Fragment block</a><br>
<a href="#materialdefinitions/fragmentblock/preparematerialfunction" class="level3"><span class="tocNumber">4.4.1 </span>prepareMaterial function</a><br>
<a href="#materialdefinitions/fragmentblock/materialfragmentinputs" class="level3"><span class="tocNumber">4.4.2 </span>Material fragment inputs</a><br>
<a href="#materialdefinitions/fragmentblock/customsurfaceshading" class="level3"><span class="tocNumber">4.4.3 </span>Custom surface shading</a><br>
<a href="#materialdefinitions/shaderpublicapis" class="level2"><span class="tocNumber">4.5 </span>Shader public APIs</a><br>
<a href="#materialdefinitions/shaderpublicapis/types" class="level3"><span class="tocNumber">4.5.1 </span>Types</a><br>
<a href="#materialdefinitions/shaderpublicapis/math" class="level3"><span class="tocNumber">4.5.2 </span>Math</a><br>
<a href="#materialdefinitions/shaderpublicapis/matrices" class="level3"><span class="tocNumber">4.5.3 </span>Matrices</a><br>
<a href="#materialdefinitions/shaderpublicapis/frameconstants" class="level3"><span class="tocNumber">4.5.4 </span>Frame constants</a><br>
<a href="#materialdefinitions/shaderpublicapis/vertexonly" class="level3"><span class="tocNumber">4.5.5 </span>Vertex only</a><br>
<a href="#materialdefinitions/shaderpublicapis/fragmentonly" class="level3"><span class="tocNumber">4.5.6 </span>Fragment only</a><br>
<a href="#compilingmaterials" class="level1"><span class="tocNumber">5 </span>Compiling materials</a><br>
<a href="#compilingmaterials/shadervalidation" class="level2"><span class="tocNumber">5.1 </span>Shader validation</a><br>
<a href="#compilingmaterials/flags" class="level2"><span class="tocNumber">5.2 </span>Flags</a><br>
<a href="#compilingmaterials/flags/—platform" class="level3"><span class="tocNumber">5.2.1 </span>—platform</a><br>
<a href="#compilingmaterials/flags/—api" class="level3"><span class="tocNumber">5.2.2 </span>—api</a><br>
<a href="#compilingmaterials/flags/—optimize-size" class="level3"><span class="tocNumber">5.2.3 </span>—optimize-size</a><br>
<a href="#compilingmaterials/flags/—reflect" class="level3"><span class="tocNumber">5.2.4 </span>—reflect</a><br>
<a href="#compilingmaterials/flags/—variant-filter" class="level3"><span class="tocNumber">5.2.5 </span>—variant-filter</a><br>
<a href="#handlingcolors" class="level1"><span class="tocNumber">6 </span>Handling colors</a><br>
<a href="#handlingcolors/linearcolors" class="level2"><span class="tocNumber">6.1 </span>Linear colors</a><br>
<a href="#handlingcolors/pre-multipliedalpha" class="level2"><span class="tocNumber">6.2 </span>Pre-multiplied alpha</a><br>
</p></div><a class="target" name="about"> </a><a class="target" name="about"> </a><a class="target" name="toc1"> </a><h1>About</h1>
<p>
This document is part of the <a href="https://github.com/google/filament">Filament project</a>. To report errors in this document please use the <a href="https://github.com/google/filament/issues">project's issue tracker</a>.
</p>
<a class="target" name="authors"> </a><a class="target" name="about/authors"> </a><a class="target" name="toc1.1"> </a><h2>Authors</h2>
<p>
</p><ul>
<li class="minus"><a href="https://github.com/romainguy">Romain Guy</a>, <a href="https://twitter.com/romainguy">@romainguy</a>
</li>
<li class="minus"><a href="https://github.com/pixelflinger">Mathias Agopian</a>, <a href="https://twitter.com/darthmoosious">@darthmoosious</a></li></ul>
<p></p>
<a class="target" name="overview"> </a><a class="target" name="overview"> </a><a class="target" name="toc2"> </a><h1>Overview</h1>
<p>
Filament is a physically based rendering (PBR) engine for Android. Filament offers a customizable
material system that you can use to create both simple and complex materials. This document
describes all the features available to materials and how to create your own material.
</p>
<a class="target" name="coreconcepts"> </a><a class="target" name="overview/coreconcepts"> </a><a class="target" name="toc2.1"> </a><h2>Core concepts</h2>
<p>
</p><dl><dt>Material</dt><dd><p> A material defines the visual appearance of a surface. To completely describe and render a
surface, a material provides the following information:
</p><p>
</p><ul>
<li class="minus">Material model
</li>
<li class="minus">Set of use-controllable named parameters
</li>
<li class="minus">Raster state (blending mode, backface culling, etc.)
</li>
<li class="minus">Vertex shader code
</li>
<li class="minus">Fragment shader code</li></ul>
<p></p></dd><dt>Material model</dt><dd><p> Also called <em class="underscore">shading model</em> or <em class="underscore">lighting model</em>, the material model defines the intrinsic
properties of a surface. These properties have a direct influence on the way lighting is
computed and therefore on the appearance of a surface.
</p></dd><dt>Material definition</dt><dd><p> A text file that describes all the information required by a material. This is the file that you
will directly author to create new materials.
</p></dd><dt>Material package</dt><dd><p> At runtime, materials are loaded from <em class="underscore">material packages</em> compiled from material definitions
using the <code>matc</code> tool. A material package contains all the information required to describe a
material, and shaders generated for the target runtime platforms. This is necessary because
different platforms (Android, macOS, Linux, etc.) use different graphics APIs or different
variants of similar graphics APIs (OpenGL vs OpenGL ES for instance).
</p></dd><dt>Material instance</dt><dd><p> A material instance is a reference to a material and a set of values for the different values of
that material. Material instances are not covered in this document as they are created and
manipulated directly from code using Filament's APIs.
</p></dd></dl><p></p>
<a class="target" name="materialmodels"> </a><a class="target" name="materialmodels"> </a><a class="target" name="toc3"> </a><h1>Material models</h1>
<p>
Filament materials can use one of the following material models:
</p><p>
</p><ul>
<li class="minus">Lit (or standard)
</li>
<li class="minus">Subsurface
</li>
<li class="minus">Cloth
</li>
<li class="minus">Unlit
</li>
<li class="minus">Specular glossiness (legacy)</li></ul>
<p></p>
<a class="target" name="litmodel"> </a><a class="target" name="materialmodels/litmodel"> </a><a class="target" name="toc3.1"> </a><h2>Lit model</h2>
<p>
The lit model is Filament's standard material model. This physically-based shading model was
designed after to offer good interoperability with other common tools and engines such as <em class="underscore">Unity 5</em>,
<em class="underscore">Unreal Engine 4</em>, <em class="underscore">Substance Designer</em> or <em class="underscore">Marmoset Toolbag</em>.
</p><p>
This material model can be used to describe many non-metallic surfaces (<em class="underscore">dielectrics</em>)
or metallic surfaces (<em class="underscore">conductors</em>).
</p><p>
The appearance of a material using the standard model is controlled using the properties described
in <a href="#table_standardproperties">table 1</a>.
</p><p>
</p><div class="table">
<table class="table"><tbody><tr><th style="text-align:right"> Property </th><th style="text-align:left"> Definition </th></tr>
<tr><td style="text-align:right"> <strong class="asterisk">baseColor</strong> </td><td style="text-align:left"> Diffuse albedo for non-metallic surfaces, and specular color for metallic surfaces </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">metallic</strong> </td><td style="text-align:left"> Whether a surface appears to be dielectric (0.0) or conductor (1.0). Often used as a binary value (0 or 1) </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">roughness</strong> </td><td style="text-align:left"> Perceived smoothness (1.0) or roughness (0.0) of a surface. Smooth surfaces exhibit sharp reflections </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">reflectance</strong> </td><td style="text-align:left"> Fresnel reflectance at normal incidence for dielectric surfaces. This directly controls the strength of the reflections </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">sheenColor</strong> </td><td style="text-align:left"> Strength of the sheen layer </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">sheenRoughness</strong> </td><td style="text-align:left"> Perceived smoothness or roughness of the sheen layer </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">clearCoat</strong> </td><td style="text-align:left"> Strength of the clear coat layer </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">clearCoatRoughness</strong> </td><td style="text-align:left"> Perceived smoothness or roughness of the clear coat layer </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">anisotropy</strong> </td><td style="text-align:left"> Amount of anisotropy in either the tangent or bitangent direction </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">anisotropyDirection</strong> </td><td style="text-align:left"> Local surface direction in tangent space </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">ambientOcclusion</strong> </td><td style="text-align:left"> Defines how much of the ambient light is accessible to a surface point. It is a per-pixel shadowing factor between 0.0 and 1.0 </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">normal</strong> </td><td style="text-align:left"> A detail normal used to perturb the surface using <em class="underscore">bump mapping</em> (<em class="underscore">normal mapping</em>) </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">bentNormal</strong> </td><td style="text-align:left"> A normal pointing in the average unoccluded direction. Can be used to improve indirect lighting quality </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">clearCoatNormal</strong> </td><td style="text-align:left"> A detail normal used to perturb the clear coat layer using <em class="underscore">bump mapping</em> (<em class="underscore">normal mapping</em>) </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">emissive</strong> </td><td style="text-align:left"> Additional diffuse albedo to simulate emissive surfaces (such as neons, etc.) This property is mostly useful in an HDR pipeline with a bloom pass </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">postLightingColor</strong> </td><td style="text-align:left"> Additional color that can be blended with the result of the lighting computations. See <code>postLightingBlending</code> </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">ior</strong> </td><td style="text-align:left"> Index of refraction, either for refractive objects or as an alternative to reflectance </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">transmission</strong> </td><td style="text-align:left"> Defines how much of the diffuse light of a dielectric is transmitted through the object, in other words this defines how transparent an object is </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">absorption</strong> </td><td style="text-align:left"> Absorption factor for refractive objects </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">microThickness</strong> </td><td style="text-align:left"> Thickness of the thin layer of refractive objects </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">thickness</strong> </td><td style="text-align:left"> Thickness of the solid volume of refractive objects </td></tr>
</tbody></table><center><div class="tablecaption"><a class="target" name="table_standardproperties"> </a><b style="font-style:normal;">Table 1:</b> Properties of the standard model</div></center></div>
<p></p><p>
The type and range of each property is described in <a href="#table_standardpropertiestypes">table 2</a>.
</p><div class="table">
<table class="table"><tbody><tr><th style="text-align:right"> Property </th><th style="text-align:center"> Type </th><th style="text-align:center"> Range </th><th style="text-align:left"> Note </th></tr>
<tr><td style="text-align:right"> <strong class="asterisk">baseColor</strong> </td><td style="text-align:center"> float4 </td><td style="text-align:center"> [0..1] </td><td style="text-align:left"> Pre-multiplied linear RGB </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">metallic</strong> </td><td style="text-align:center"> float </td><td style="text-align:center"> [0..1] </td><td style="text-align:left"> Should be 0 or 1 </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">roughness</strong> </td><td style="text-align:center"> float </td><td style="text-align:center"> [0..1] </td><td style="text-align:left"> </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">reflectance</strong> </td><td style="text-align:center"> float </td><td style="text-align:center"> [0..1] </td><td style="text-align:left"> Prefer values > 0.35 </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">sheenColor</strong> </td><td style="text-align:center"> float3 </td><td style="text-align:center"> [0..1] </td><td style="text-align:left"> Linear RGB </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">sheenRoughness</strong> </td><td style="text-align:center"> float </td><td style="text-align:center"> [0..1] </td><td style="text-align:left"> </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">clearCoat</strong> </td><td style="text-align:center"> float </td><td style="text-align:center"> [0..1] </td><td style="text-align:left"> Should be 0 or 1 </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">clearCoatRoughness</strong> </td><td style="text-align:center"> float </td><td style="text-align:center"> [0..1] </td><td style="text-align:left"> </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">anisotropy</strong> </td><td style="text-align:center"> float </td><td style="text-align:center"> [−1..1] </td><td style="text-align:left"> Anisotropy is in the tangent direction when this value is positive </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">anisotropyDirection</strong> </td><td style="text-align:center"> float3 </td><td style="text-align:center"> [0..1] </td><td style="text-align:left"> Linear RGB, encodes a direction vector in tangent space </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">ambientOcclusion</strong> </td><td style="text-align:center"> float </td><td style="text-align:center"> [0..1] </td><td style="text-align:left"> </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">normal</strong> </td><td style="text-align:center"> float3 </td><td style="text-align:center"> [0..1] </td><td style="text-align:left"> Linear RGB, encodes a direction vector in tangent space </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">bentNormal</strong> </td><td style="text-align:center"> float3 </td><td style="text-align:center"> [0..1] </td><td style="text-align:left"> Linear RGB, encodes a direction vector in tangent space </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">clearCoatNormal</strong> </td><td style="text-align:center"> float3 </td><td style="text-align:center"> [0..1] </td><td style="text-align:left"> Linear RGB, encodes a direction vector in tangent space </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">emissive</strong> </td><td style="text-align:center"> float4 </td><td style="text-align:center"> rgb=[0..n], a=[0..1] </td><td style="text-align:left"> Linear RGB intensity in nits, alpha encodes the exposure weight </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">postLightingColor</strong> </td><td style="text-align:center"> float4 </td><td style="text-align:center"> [0..1] </td><td style="text-align:left"> Pre-multiplied linear RGB </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">ior</strong> </td><td style="text-align:center"> float </td><td style="text-align:center"> [1..n] </td><td style="text-align:left"> Optional, usually deduced from the reflectance </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">transmission</strong> </td><td style="text-align:center"> float </td><td style="text-align:center"> [0..1] </td><td style="text-align:left"> </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">absorption</strong> </td><td style="text-align:center"> float3 </td><td style="text-align:center"> [0..n] </td><td style="text-align:left"> </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">microThickness</strong> </td><td style="text-align:center"> float </td><td style="text-align:center"> [0..n] </td><td style="text-align:left"> </td></tr>
<tr><td style="text-align:right"> <strong class="asterisk">thickness</strong> </td><td style="text-align:center"> float </td><td style="text-align:center"> [0..n] </td><td style="text-align:left"> </td></tr>
</tbody></table><center><div class="tablecaption"><a class="target" name="table_standardpropertiestypes"> </a><b style="font-style:normal;">Table 2:</b> Range and type of the standard model's properties</div></center></div>
<p></p><p>
</p><div class="admonition note"><div class="admonition-title"> About linear RGB</div>
<p></p><p>
Several material model properties expect RGB colors. Filament materials use RGB colors in linear
space and you must take proper care of supplying colors in that space. See the <a href="#linearcolors">Linear colors</a> section for more information.</p></div>
<p></p><p>
</p><div class="admonition note"><div class="admonition-title"> About pre-multiplied RGB</div>
<p></p><p>
Filament materials expect colors to use pre-multiplied alpha. See the <a href="#pre-multipliedalpha">Pre-multiplied alpha</a> section for more information.</p></div>
<p></p><p>
</p><div class="admonition note"><div class="admonition-title"> About <code>absorption</code></div>
<p></p><p>
The light attenuation through the material is defined as \(e^{-absorption \cdot distance}\),
and the distance depends on the <code>thickness</code> parameter. If <code>thickness</code> is not provided, then
the <code>absorption</code> parameter is used directly and the light attenuation through the material
becomes \(1 - absorption\). To obtain a certain color at a desired distance, the above
equation can be inverted such as \(absorption = -\frac{ln(color)}{distance}\).</p></div>
<p></p><p>
</p><div class="admonition note"><div class="admonition-title"> About <code>ior</code> and <code>reflectance</code></div>
<p></p><p>
The index of refraction (IOR) and the reflectance represent the same physical attribute,
therefore they don't need to be both specified. Typically, only the reflectance is specified,
and the IOR is deduced automatically. When only the IOR is specified, the reflectance is then
deduced automatically. It is possible to specify both, in which case their values are kept
as-is, which can lead to physically impossible materials, however, this might be desirable
for artistic reasons.</p></div>
<p></p><p>
</p><div class="admonition note"><div class="admonition-title"> About <code>thickness</code> and <code>microThickness</code> for refraction</div>
<p></p><p>
<code>thickness</code> represents the thickness of solid objects in the direction of the normal, for
satisfactory results, this should be provided per fragment (e.g.: as a texture) or at least per
vertex. <code>microThickness</code> represent the thickness of the thin layer of an object, and can
generally be provided as a constant value. For example, a 1mm thin hollow sphere of radius 1m,
would have a <code>thickness</code> of 1 and a <code>microThickness</code> of 0.001. Currently <code>thickness</code> is not
used when <code>refractionType</code> is set to <code>thin</code>.</p></div>
<p></p>
<a class="target" name="basecolor"> </a><a class="target" name="materialmodels/litmodel/basecolor"> </a><a class="target" name="toc3.1.1"> </a><h3>Base color</h3>
<p>
The <code>baseColor</code> property defines the perceived color of an object (sometimes called albedo). The
effect of <code>baseColor</code> depends on the nature of the surface, controlled by the <code>metallic</code> property
explained in the <a href="#metallic">Metallic</a> section.
</p><p>
</p><dl><dt>Non-metals (dielectrics)</dt><dd><p> Defines the diffuse color of the surface. Real-world values are typically found in the range
\([10..240]\) if the value is encoded between 0 and 255, or in the range \([0.04..0.94]\) between 0
and 1. Several examples of base colors for non-metallic surfaces can be found in
<a href="#table_basecolorsdielectrics">table 3</a>.
</p></dd></dl><div class="table">
<table class="table"><tbody><tr><th style="text-align:right"> Metal </th><th style="text-align:center"> sRGB </th><th style="text-align:center"> Hexadecimal </th><th style="text-align:left"> Color </th></tr>
<tr><td style="text-align:right"> Coal </td><td style="text-align:center"> 0.19, 0.19, 0.19 </td><td style="text-align:center"> #323232 </td><td style="text-align:left"> <div style="background-color: #323232; width: 60px"> </div> </td></tr>
<tr><td style="text-align:right"> Rubber </td><td style="text-align:center"> 0.21, 0.21, 0.21 </td><td style="text-align:center"> #353535 </td><td style="text-align:left"> <div style="background-color: #353535; width: 60px"> </div> </td></tr>
<tr><td style="text-align:right"> Mud </td><td style="text-align:center"> 0.33, 0.24, 0.19 </td><td style="text-align:center"> #553d31 </td><td style="text-align:left"> <div style="background-color: #875c3c; width: 60px"> </div> </td></tr>
<tr><td style="text-align:right"> Wood </td><td style="text-align:center"> 0.53, 0.36, 0.24 </td><td style="text-align:center"> #875c3c </td><td style="text-align:left"> <div style="background-color: #c4c6c6; width: 60px"> </div> </td></tr>
<tr><td style="text-align:right"> Vegetation </td><td style="text-align:center"> 0.48, 0.51, 0.31 </td><td style="text-align:center"> #7b824e </td><td style="text-align:left"> <div style="background-color: #7b824e; width: 60px"> </div> </td></tr>
<tr><td style="text-align:right"> Brick </td><td style="text-align:center"> 0.58, 0.49, 0.46 </td><td style="text-align:center"> #947d75 </td><td style="text-align:left"> <div style="background-color: #947d75; width: 60px"> </div> </td></tr>
<tr><td style="text-align:right"> Sand </td><td style="text-align:center"> 0.69, 0.66, 0.52 </td><td style="text-align:center"> #b1a884 </td><td style="text-align:left"> <div style="background-color: #b1a884; width: 60px"> </div> </td></tr>
<tr><td style="text-align:right"> Concrete </td><td style="text-align:center"> 0.75, 0.75, 0.73 </td><td style="text-align:center"> #c0bfbb </td><td style="text-align:left"> <div style="background-color: #c0bfbb; width: 60px"> </div> </td></tr>
</tbody></table><center><div class="tablecaption"><a class="target" name="table_basecolorsdielectrics"> </a><b style="font-style:normal;">Table 3:</b> <code>baseColor</code> for common non-metals</div></center></div>
<p></p><p>
</p><dl><dt>Metals (conductors)</dt><dd><p> Defines the specular color of the surface. Real-world values are typically found in the range
\([170..255]\) if the value is encoded between 0 and 255, or in the range \([0.66..1.0]\) between 0 and
1. Several examples of base colors for metallic surfaces can be found in <a href="#table_basecolorsconductors">table 4</a>.
</p></dd></dl><div class="table">
<table class="table"><tbody><tr><th style="text-align:right"> Metal </th><th style="text-align:center"> sRGB </th><th style="text-align:center"> Hexadecimal </th><th style="text-align:left"> Color </th></tr>
<tr><td style="text-align:right"> Silver </td><td style="text-align:center"> 0.97, 0.96, 0.91 </td><td style="text-align:center"> #f7f4e8 </td><td style="text-align:left"> <div style="background-color: #faf9f5; width: 60px"> </div> </td></tr>
<tr><td style="text-align:right"> Aluminum </td><td style="text-align:center"> 0.91, 0.92, 0.92 </td><td style="text-align:center"> #e8eaea </td><td style="text-align:left"> <div style="background-color: #f4f5f5; width: 60px"> </div> </td></tr>
<tr><td style="text-align:right"> Titanium </td><td style="text-align:center"> 0.76, 0.73, 0.69 </td><td style="text-align:center"> #c1baaf </td><td style="text-align:left"> <div style="background-color: #cec8c2; width: 60px"> </div> </td></tr>
<tr><td style="text-align:right"> Iron </td><td style="text-align:center"> 0.77, 0.78, 0.78 </td><td style="text-align:center"> #c4c6c6 </td><td style="text-align:left"> <div style="background-color: #c0bdba; width: 60px"> </div> </td></tr>
<tr><td style="text-align:right"> Platinum </td><td style="text-align:center"> 0.83, 0.81, 0.78 </td><td style="text-align:center"> #d3cec6 </td><td style="text-align:left"> <div style="background-color: #d6d1c8; width: 60px"> </div> </td></tr>
<tr><td style="text-align:right"> Gold </td><td style="text-align:center"> 1.00, 0.85, 0.57 </td><td style="text-align:center"> #ffd891 </td><td style="text-align:left"> <div style="background-color: #fedc9d; width: 60px"> </div> </td></tr>
<tr><td style="text-align:right"> Brass </td><td style="text-align:center"> 0.98, 0.90, 0.59 </td><td style="text-align:center"> #f9e596 </td><td style="text-align:left"> <div style="background-color: #f4e4ad; width: 60px"> </div> </td></tr>
<tr><td style="text-align:right"> Copper </td><td style="text-align:center"> 0.97, 0.74, 0.62 </td><td style="text-align:center"> #f7bc9e </td><td style="text-align:left"> <div style="background-color: #fbd8b8; width: 60px"> </div> </td></tr>
</tbody></table><center><div class="tablecaption"><a class="target" name="table_basecolorsconductors"> </a><b style="font-style:normal;">Table 4:</b> <code>baseColor</code> for common metals</div></center></div>
<p></p>
<a class="target" name="metallic"> </a><a class="target" name="materialmodels/litmodel/metallic"> </a><a class="target" name="toc3.1.2"> </a><h3>Metallic</h3>
<p>
The <code>metallic</code> property defines whether the surface is a metallic (<em class="underscore">conductor</em>) or a non-metallic
(<em class="underscore">dielectric</em>) surface. This property should be used as a binary value, set to either 0 or 1.
Intermediate values are only truly useful to create transitions between different types of surfaces
when using textures.
</p><p>
This property can dramatically change the appearance of a surface. Non-metallic surfaces have
chromatic diffuse reflection and achromatic specular reflection (reflected light does not change
color). Metallic surfaces do not have any diffuse reflection and chromatic specular reflection
(reflected light takes on the color of the surfaced as defined by <code>baseColor</code>).
</p><p>
The effect of <code>metallic</code> is shown in <a href="#figure_metallicproperty">figure 1</a> (click on the image to see a
larger version).
</p><p>
</p><center><div class="image" style=""><a href="images/materials/metallic.png" target="_blank"><img class="markdeep" src="images/materials/metallic.png"></a><center><span class="imagecaption"><a class="target" name="figure_metallicproperty"> </a><b style="font-style:normal;">Figure 1:</b> <code>metallic</code> varying from 0.0
(left) to 1.0 (right)</span></center></div></center>
<p></p>
<a class="target" name="roughness"> </a><a class="target" name="materialmodels/litmodel/roughness"> </a><a class="target" name="toc3.1.3"> </a><h3>Roughness</h3>
<p>
The <code>roughness</code> property controls the perceived smoothness of the surface. When <code>roughness</code> is set
to 0, the surface is perfectly smooth and highly glossy. The rougher a surface is, the “blurrier”
the reflections are. This property is often called <em class="underscore">glossiness</em> in other engines and tools, and is
simply the opposite of the roughness (<code>roughness = 1 - glossiness</code>).
</p>
<a class="target" name="non-metals"> </a><a class="target" name="materialmodels/litmodel/non-metals"> </a><a class="target" name="toc3.1.4"> </a><h3>Non-metals</h3>
<p>
The effect of <code>roughness</code> on non-metallic surfaces is shown in <a href="#figure_roughnessproperty">figure 2</a> (click
on the image to see a larger version).
</p><p>
</p><center><div class="image" style=""><a href="images/materials/dielectric_roughness.png" target="_blank"><img class="markdeep" src="images/materials/dielectric_roughness.png"></a><center><span class="imagecaption"><a class="target" name="figure_roughnessproperty"> </a><b style="font-style:normal;">Figure 2:</b> Dielectric <code>roughness</code> varying from 0.0
(left) to 1.0 (right)</span></center></div></center>
<p></p>
<a class="target" name="metals"> </a><a class="target" name="materialmodels/litmodel/metals"> </a><a class="target" name="toc3.1.5"> </a><h3>Metals</h3>
<p>
The effect of <code>roughness</code> on metallic surfaces is shown in <a href="#figure_roughnessconductorproperty">figure 3</a>
(click on the image to see a larger version).
</p><p>
</p><center><div class="image" style=""><a href="images/materials/conductor_roughness.png" target="_blank"><img class="markdeep" src="images/materials/conductor_roughness.png"></a><center><span class="imagecaption"><a class="target" name="figure_roughnessconductorproperty"> </a><b style="font-style:normal;">Figure 3:</b> Conductor <code>roughness</code> varying from 0.0
(left) to 1.0 (right)</span></center></div></center>
<p></p>
<a class="target" name="refraction"> </a><a class="target" name="materialmodels/litmodel/refraction"> </a><a class="target" name="toc3.1.6"> </a><h3>Refraction</h3>
<p>
When refraction through an object is enabled (using a <code>refractonType</code> of <code>thin</code> or <code>solid</code>), the
<code>roughness</code> property will also affect the refractions, as shown in <a href="#figure_roughnessrefractionproperty">figure 4</a> (click on the image to see a larger version).
</p><p>
</p><center><div class="image" style=""><a href="images/materials/refraction_roughness.png" target="_blank"><img class="markdeep" src="images/materials/refraction_roughness.png"></a><center><span class="imagecaption"><a class="target" name="figure_roughnessrefractionproperty"> </a><b style="font-style:normal;">Figure 4:</b> Refractive sphere with <code>roughness</code> varying from 0.0
(left) to 1.0 (right)</span></center></div></center>
<p></p>
<a class="target" name="reflectance"> </a><a class="target" name="materialmodels/litmodel/reflectance"> </a><a class="target" name="toc3.1.7"> </a><h3>Reflectance</h3>
<p>
The <code>reflectance</code> property only affects non-metallic surfaces. This property can be used to control
the specular intensity and index of refraction of materials. This value is defined
between 0 and 1 and represents a remapping of a percentage of reflectance. For instance, the
default value of 0.5 corresponds to a reflectance of 4%. Values below 0.35 (2% reflectance) should
be avoided as no real-world materials have such low reflectance.
</p><p>
The effect of <code>reflectance</code> on non-metallic surfaces is shown in <a href="#figure_reflectanceproperty">figure 5</a>
(click on the image to see a larger version).
</p><p>
</p><center><div class="image" style=""><a href="images/materials/reflectance.png" target="_blank"><img class="markdeep" src="images/materials/reflectance.png"></a><center><span class="imagecaption"><a class="target" name="figure_reflectanceproperty"> </a><b style="font-style:normal;">Figure 5:</b> <code>reflectance</code> varying from 0.0 (left)
to 1.0 (right)</span></center></div></center>
<p></p><p>
<a href="#figure_reflectance">Figure 6</a> shows common values and how they relate to the mapping function.
</p><p>
</p><center><div class="image" style=""><a href="images/diagram_reflectance.png" target="_blank"><img class="markdeep" src="images/diagram_reflectance.png"></a><center><span class="imagecaption"><a class="target" name="figure_reflectance"> </a><b style="font-style:normal;">Figure 6:</b> Common reflectance values</span></center></div></center>
<p></p><p>
<a href="#table_commonmatreflectance">Table 5</a> describes acceptable reflectance values for various types of materials
(no real world material has a value under 2%).
</p><p>
</p><div class="table">
<table class="table"><tbody><tr><th style="text-align:right"> Material </th><th style="text-align:left"> Reflectance </th><th style="text-align:left"> IOR </th><th style="text-align:left"> Linear value </th></tr>
<tr><td style="text-align:right"> Water </td><td style="text-align:left"> 2% </td><td style="text-align:left"> 1.33 </td><td style="text-align:left"> 0.35 </td></tr>
<tr><td style="text-align:right"> Fabric </td><td style="text-align:left"> 4% to 5.6% </td><td style="text-align:left"> 1.5 to 1.62 </td><td style="text-align:left"> 0.5 to 0.59 </td></tr>
<tr><td style="text-align:right"> Common liquids </td><td style="text-align:left"> 2% to 4% </td><td style="text-align:left"> 1.33 to 1.5 </td><td style="text-align:left"> 0.35 to 0.5 </td></tr>
<tr><td style="text-align:right"> Common gemstones </td><td style="text-align:left"> 5% to 16% </td><td style="text-align:left"> 1.58 to 2.33 </td><td style="text-align:left"> 0.56 to 1.0 </td></tr>
<tr><td style="text-align:right"> Plastics, glass </td><td style="text-align:left"> 4% to 5% </td><td style="text-align:left"> 1.5 to 1.58 </td><td style="text-align:left"> 0.5 to 0.56 </td></tr>
<tr><td style="text-align:right"> Other dielectric materials </td><td style="text-align:left"> 2% to 5% </td><td style="text-align:left"> 1.33 to 1.58 </td><td style="text-align:left"> 0.35 to 0.56 </td></tr>
<tr><td style="text-align:right"> Eyes </td><td style="text-align:left"> 2.5% </td><td style="text-align:left"> 1.38 </td><td style="text-align:left"> 0.39 </td></tr>
<tr><td style="text-align:right"> Skin </td><td style="text-align:left"> 2.8% </td><td style="text-align:left"> 1.4 </td><td style="text-align:left"> 0.42 </td></tr>
<tr><td style="text-align:right"> Hair </td><td style="text-align:left"> 4.6% </td><td style="text-align:left"> 1.55 </td><td style="text-align:left"> 0.54 </td></tr>
<tr><td style="text-align:right"> Teeth </td><td style="text-align:left"> 5.8% </td><td style="text-align:left"> 1.63 </td><td style="text-align:left"> 0.6 </td></tr>
<tr><td style="text-align:right"> Default value </td><td style="text-align:left"> 4% </td><td style="text-align:left"> 1.5 </td><td style="text-align:left"> 0.5 </td></tr>
</tbody></table><center><div class="tablecaption"><a class="target" name="table_commonmatreflectance"> </a><b style="font-style:normal;">Table 5:</b> Reflectance of common materials</div></center></div>
<p></p><p>
Note that the <code>reflectance</code> property also defines the index of refraction of the surface.
When this property is defined it is not necessary to define the <code>ior</code> property. Setting
either of these properties will automatically compute the other property. It is possible
to specify both, in which case their values are kept as-is, which can lead to physically
impossible materials, however, this might be desirable for artistic reasons.
</p><p>
The <code>reflectance</code> property is designed as a normalized property in the range 0..1 which makes
it easy to define from a texture.
</p><p>
See section <a href="#toc3.1.20">3.1.20</a> for more information about the <code>ior</code> property and refractive
indices.
</p>
<a class="target" name="sheencolor"> </a><a class="target" name="materialmodels/litmodel/sheencolor"> </a><a class="target" name="toc3.1.8"> </a><h3>Sheen color</h3>
<p>
The sheen color controls the color appearance and strength of an optional sheen layer on top of the
base layer described by the properties above. The sheen layer always sits below the clear coat layer
if such a layer is present.
</p><p>
The sheen layer can be used to represent cloth and fabric materials. Please refer to
section <a href="#toc3.3">3.3</a> for more information about cloth and fabric materials.
</p><p>
The effect of <code>sheenColor</code> is shown in <a href="#figure_materialsheencolor">figure 7</a>
(click on the image to see a larger version).
</p><p>
</p><center><div class="image" style=""><a href="images/screenshot_sheen_color.png" target="_blank"><img class="markdeep" src="images/screenshot_sheen_color.png"></a><center><span class="imagecaption"><a class="target" name="figure_materialsheencolor"> </a><b style="font-style:normal;">Figure 7:</b> Different sheen colors</span></center></div></center>
<p></p><p>
</p><div class="admonition note">If you do not need the other properties offered by the standard lit material model but want to
create a cloth-like or fabric-like appearance, it is more efficient to use the dedicated cloth
model described in section <a href="#toc3.3">3.3</a>.</div>
<p></p>
<a class="target" name="sheenroughness"> </a><a class="target" name="materialmodels/litmodel/sheenroughness"> </a><a class="target" name="toc3.1.9"> </a><h3>Sheen roughness</h3>
<p>
The <code>sheenRoughness</code> property is similar to the <code>roughness</code> property but applies only to the
sheen layer.
</p><p>
The effect of <code>sheenRoughness</code> on a rough metal is shown in <a href="#figure_sheenroughnessproperty">figure 8</a>
(click on the image to see a larger version). In this picture, the base layer is a dark blue, with
<code>metallic</code> set to <code>0.0</code> and <code>roughness</code> set to <code>1.0</code>.
</p><p>
</p><center><div class="image" style=""><a href="images/materials/sheen_roughness.png" target="_blank"><img class="markdeep" src="images/materials/sheen_roughness.png"></a><center><span class="imagecaption"><a class="target" name="figure_sheenroughnessproperty"> </a><b style="font-style:normal;">Figure 8:</b> <code>sheenRoughness</code> varying from 0.0
(left) to 1.0 (right)</span></center></div></center>
<p></p>
<a class="target" name="clearcoat"> </a><a class="target" name="materialmodels/litmodel/clearcoat"> </a><a class="target" name="toc3.1.10"> </a><h3>Clear coat</h3>
<p>
Multi-layer materials are fairly common, particularly materials with a thin translucent
layer over a base layer. Real world examples of such materials include car paints, soda cans,
lacquered wood and acrylic.
</p><p>
The <code>clearCoat</code> property can be used to describe materials with two layers. The clear coat layer
will always be isotropic and dielectric.
</p><p>
</p><center><div class="image" style=""><a href="images/material_carbon_fiber.png" target="_blank"><img class="markdeep" src="images/material_carbon_fiber.png"></a><center><span class="imagecaption"><a class="target" name="figure_clearcoat"> </a><b style="font-style:normal;">Figure 9:</b> Comparison of a carbon-fiber material under the standard material model
(left) and the clear coat model (right)</span></center></div></center>
<p></p><p>
The <code>clearCoat</code> property controls the strength of the clear coat layer. This should be treated as a
binary value, set to either 0 or 1. Intermediate values are useful to control transitions between
parts of the surface that have a clear coat layers and parts that don't.
</p><p>
The effect of <code>clearCoat</code> on a rough metal is shown in <a href="#figure_clearcoatproperty">figure 10</a>
(click on the image to see a larger version).
</p><p>
</p><center><div class="image" style=""><a href="images/materials/clear_coat.png" target="_blank"><img class="markdeep" src="images/materials/clear_coat.png"></a><center><span class="imagecaption"><a class="target" name="figure_clearcoatproperty"> </a><b style="font-style:normal;">Figure 10:</b> <code>clearCoat</code> varying from 0.0
(left) to 1.0 (right)</span></center></div></center>
<p></p><p>
</p><div class="admonition warning">The clear coat layer effectively doubles the cost of specular computations. Do not assign a
value, even 0.0, to the clear coat property if you don't need this second layer.</div>
<p></p><p>
</p><div class="admonition note">The clear coat layer is added on top of the sheen layer if present.</div>
<p></p>
<a class="target" name="clearcoatroughness"> </a><a class="target" name="materialmodels/litmodel/clearcoatroughness"> </a><a class="target" name="toc3.1.11"> </a><h3>Clear coat roughness</h3>
<p>
The <code>clearCoatRoughness</code> property is similar to the <code>roughness</code> property but applies only to the
clear coat layer.
</p><p>
The effect of <code>clearCoatRoughness</code> on a rough metal is shown in <a href="#figure_clearcoatroughnessproperty">figure 11</a>
(click on the image to see a larger version).
</p><p>
</p><center><div class="image" style=""><a href="images/materials/clear_coat_roughness.png" target="_blank"><img class="markdeep" src="images/materials/clear_coat_roughness.png"></a><center><span class="imagecaption"><a class="target" name="figure_clearcoatroughnessproperty"> </a><b style="font-style:normal;">Figure 11:</b> <code>clearCoatRoughness</code> varying from 0.0
(left) to 1.0 (right)</span></center></div></center>
<p></p>
<a class="target" name="anisotropy"> </a><a class="target" name="materialmodels/litmodel/anisotropy"> </a><a class="target" name="toc3.1.12"> </a><h3>Anisotropy</h3>
<p>
Many real-world materials, such as brushed metal, can only be replicated using an anisotropic
reflectance model. A material can be changed from the default isotropic model to an anisotropic
model by using the <code>anisotropy</code> property.
</p><p>
</p><center><div class="image" style=""><a href="images/material_anisotropic.png" target="_blank"><img class="markdeep" src="images/material_anisotropic.png"></a><center><span class="imagecaption"><a class="target" name="figure_anisotropic"> </a><b style="font-style:normal;">Figure 12:</b> Comparison of isotropic material
(left) and anistropic material (right)</span></center></div></center>
<p></p><p>
The effect of <code>anisotropy</code> on a rough metal is shown in <a href="#figure_anisotropyproperty">figure 13</a>
(click on the image to see a larger version).
</p><p>
</p><center><div class="image" style=""><a href="images/materials/anisotropy.png" target="_blank"><img class="markdeep" src="images/materials/anisotropy.png"></a><center><span class="imagecaption"><a class="target" name="figure_anisotropyproperty"> </a><b style="font-style:normal;">Figure 13:</b> <code>anisotropy</code> varying from 0.0
(left) to 1.0 (right)</span></center></div></center>
<p></p><p>
The <a href="#figure_anisotropydir">figure 14</a> below shows how the direction of the anisotropic highlights can be
controlled by using either positive or negative values: positive values define anisotropy in the
tangent direction and negative values in the bitangent direction.
</p><p>
</p><center><div class="image" style=""><a href="images/screenshot_anisotropy_direction.png" target="_blank"><img class="markdeep" src="images/screenshot_anisotropy_direction.png"></a><center><span class="imagecaption"><a class="target" name="figure_anisotropydir"> </a><b style="font-style:normal;">Figure 14:</b> Positive (left) vs negative
(right) <code>anisotropy</code> values</span></center></div></center>
<p></p><p>
</p><div class="admonition tip">The anisotropic material model is slightly more expensive than the standard material model. Do
not assign a value (even 0.0) to the <code>anisotropy</code> property if you don't need anisotropy.</div>
<p></p>
<a class="target" name="anisotropydirection"> </a><a class="target" name="materialmodels/litmodel/anisotropydirection"> </a><a class="target" name="toc3.1.13"> </a><h3>Anisotropy direction</h3>
<p>
The <code>anisotropyDirection</code> property defines the direction of the surface at a given point and thus
control the shape of the specular highlights. It is specified as vector of 3 values that usually
come from a texture, encoding the directions local to the surface in tangent space. Because the
direction is in tangent space, the Z component should be set to 0.
</p><p>
The effect of <code>anisotropyDirection</code> on a metal is shown in <a href="#figure_anisotropydirectionproperty">figure 16</a>
(click on the image to see a larger version).
</p><p>
</p><center><div class="image" style=""><a href="images/screenshot_anisotropy.png" target="_blank"><img class="markdeep" src="images/screenshot_anisotropy.png"></a><center><span class="imagecaption"><a class="target" name="figure_anisotropydirectionproperty"> </a><b style="font-style:normal;">Figure 15:</b> Anisotropic metal rendered
with a direction map</span></center></div></center>
<p></p><p>
The result shown in <a href="#figure_anisotropydirectionproperty">figure 16</a> was obtained using the direction map shown
in <a href="#figure_anisotropydirectionproperty">figure 16</a>.
</p><p>
</p><center><div class="image" style=""><a href="images/screenshot_anisotropy_map.jpg" target="_blank"><img class="markdeep" src="images/screenshot_anisotropy_map.jpg"></a><center><span class="imagecaption"><a class="target" name="figure_anisotropydirectionproperty"> </a><b style="font-style:normal;">Figure 16:</b> Example of Lighting: specularAmbientOcclusiona direction map</span></center></div></center>
<p></p>
<a class="target" name="ambientocclusion"> </a><a class="target" name="materialmodels/litmodel/ambientocclusion"> </a><a class="target" name="toc3.1.14"> </a><h3>Ambient occlusion</h3>
<p>
The <code>ambientOcclusion</code> property defines how much of the ambient light is accessible to a surface
point. It is a per-pixel shadowing factor between 0.0 (fully shadowed) and 1.0 (fully lit). This
property only affects diffuse indirect lighting (image-based lighting), not direct lights such as
directional, point and spot lights, nor specular lighting.
</p><p>
</p><center><div class="image" style=""><a href="images/screenshot_ao.jpg" target="_blank"><img class="markdeep" src="images/screenshot_ao.jpg"></a><center><span class="imagecaption"><a class="target" name="figure_aoexample"> </a><b style="font-style:normal;">Figure 17:</b> Comparison of materials without diffuse ambient occlusion
(left) and with (right)</span></center></div></center>
<p></p>
<a class="target" name="normal"> </a><a class="target" name="materialmodels/litmodel/normal"> </a><a class="target" name="toc3.1.15"> </a><h3>Normal</h3>
<p>
The <code>normal</code> property defines the normal of the surface at a given point. It usually comes from a
<em class="underscore">normal map</em> texture, which allows to vary the property per-pixel. The normal is supplied in tangent
space, which means that +Z points outside of the surface.
</p><p>
For example, let's imagine that we want to render a piece of furniture covered in tufted leather.
Modeling the geometry to accurately represent the tufted pattern would require too many triangles
so we instead bake a high-poly mesh into a normal map. Once the base map is applied to a simplified
mesh, we get the result in <a href="#figure_normalmapped">figure 18</a>.
</p><p>
Note that the <code>normal</code> property affects the <em class="underscore">base layer</em> and not the clear coat layer.
</p><p>
</p><center><div class="image" style=""><a href="images/screenshot_normal_mapping.jpg" target="_blank"><img class="markdeep" src="images/screenshot_normal_mapping.jpg"></a><center><span class="imagecaption"><a class="target" name="figure_normalmapped"> </a><b style="font-style:normal;">Figure 18:</b> Low-poly mesh without normal mapping (left)
and with (right)</span></center></div></center>
<p></p><p>
</p><div class="admonition warning">Using a normal map increases the runtime cost of the material model.</div>
<p></p>
<a class="target" name="bentnormal"> </a><a class="target" name="materialmodels/litmodel/bentnormal"> </a><a class="target" name="toc3.1.16"> </a><h3>Bent normal</h3>
<p>
The <code>bentNormal</code> property defines the average unoccluded direction at a point on the surface. It is
used to improve the accuracy of indirect lighting. Bent normals can also improve the quality of
specular ambient occlusion (see section <a href="#toc4.2.32">4.2.32</a> about
<code>specularAmbientOcclusion</code>).
</p><p>
Bent normals can greatly increase the visual fidelity of an asset with various cavities and concave
areas, as shown in <a href="#figure_bentnormalmapped">figure 19</a>. See the areas of the ears, nostrils and eyes for
instance.
</p><p>
</p><center><div class="image" style=""><a href="images/material_bent_normal.gif" target="_blank"><img class="markdeep" src="images/material_bent_normal.gif"></a><center><span class="imagecaption"><a class="target" name="figure_bentnormalmapped"> </a><b style="font-style:normal;">Figure 19:</b> Example of a model rendered with and without a bent normal map. Both
versions use the same ambient occlusion map.</span></center></div></center>
<p></p>
<a class="target" name="clearcoatnormal"> </a><a class="target" name="materialmodels/litmodel/clearcoatnormal"> </a><a class="target" name="toc3.1.17"> </a><h3>Clear coat normal</h3>
<p>
The <code>clearCoatNormal</code> property defines the normal of the clear coat layer at a given point. It
behaves otherwise like the <code>normal</code> property.
</p><p>
</p><center><div class="image" style=""><a href="images/screenshot_clear_coat_normal.jpg" target="_blank"><img class="markdeep" src="images/screenshot_clear_coat_normal.jpg"></a><center><span class="imagecaption"><a class="target" name="figure_clearcoatnormalmapped"> </a><b style="font-style:normal;">Figure 20:</b> A material with a clear coat normal
map and a surface normal map</span></center></div></center>
<p></p><p>
</p><div class="admonition warning">Using a clear coat normal map increases the runtime cost of the material model.</div>
<p></p>
<a class="target" name="emissive"> </a><a class="target" name="materialmodels/litmodel/emissive"> </a><a class="target" name="toc3.1.18"> </a><h3>Emissive</h3>
<p>
The <code>emissive</code> property can be used to simulate additional light emitted by the surface. It is
defined as a <code>float4</code> value that contains an RGB intensity in nits as well as an exposure
weight (in the alpha channel).
</p><p>
The intensity in nits allows an emissive surface to function as a light and can be used to recreate
real world surfaces. For instance a computer display has an intensity between 200 and 1,000 nits.
</p><p>
If you prefer to work in EV (or f-stops), you can simplify multiply your emissive color by the
output of the API <code>filament::Exposure::luminance(ev)</code>. This API returns the luminance in nits of
the specific EV. You can perform this conversion yourself using the following formula, where \(L\)
is the final intensity in nits: \( L = 2^{EV - 3} \).
</p><p>
The exposure weight carried in the alpha channel can be used to undo the camera exposure, and thus
force an emissive surface to bloom. When the exposure weight is set to 0, the emissive intensity is
not affected by the camera exposure. When the weight is set to 1, the intensity is multiplied by
the camera exposure like with any regular light.
</p>
<a class="target" name="post-lightingcolor"> </a><a class="target" name="materialmodels/litmodel/post-lightingcolor"> </a><a class="target" name="toc3.1.19"> </a><h3>Post-lighting color</h3>
<p>
The <code>postLightingColor</code> can be used to modify the surface color after lighting computations. This
property has no physical meaning and only exists to implement specific effects or to help with
debugging. This property is defined as a <code>float4</code> value containing a pre-multiplied RGB color in
linear space.
</p><p>
The post-lighting color is blended with the result of lighting according to the blending mode
specified by the <code>postLightingBlending</code> material option. Please refer to the documentation of
this option for more information.
</p><p>
</p><div class="admonition tip"><code>postLightingColor</code> can be used as a simpler <code>emissive</code> property by setting
<code>postLightingBlending</code> to <code>add</code> and by providing an RGB color with alpha set to <code>0.0</code>.</div>
<p></p>
<a class="target" name="indexofrefraction"> </a><a class="target" name="materialmodels/litmodel/indexofrefraction"> </a><a class="target" name="toc3.1.20"> </a><h3>Index of refraction</h3>
<p>
The <code>ior</code> property only affects non-metallic surfaces. This property can be used to control the
index of refraction and the specular intensity of materials. The <code>ior</code> property is intended to
be used with refractive (transmissive) materials, which are enabled when the <code>refractionMode</code> is
set to <code>cubemap</code> or <code>screenspace</code>. It can also be used on non-refractive objects as an alternative
to setting the reflectance.
</p><p>
The index of refraction (or refractive index) of a material is a dimensionless number that describes
how fast light travels through that material. The higher the number, the slower light travels
through the medium. More importantly for rendering materials, the refractive index determines how
the path light travels is bent when entering the material. Higher indices of refraction will cause
light to bend further away from the initial path.
</p><p>
<a href="#table_commonmatior">Table 6</a> describes acceptable refractive indices for various types of materials.
</p><div class="table">
<table class="table"><tbody><tr><th style="text-align:right"> Material </th><th style="text-align:left"> IOR </th></tr>
<tr><td style="text-align:right"> Air </td><td style="text-align:left"> 1.0 </td></tr>
<tr><td style="text-align:right"> Water </td><td style="text-align:left"> 1.33 </td></tr>
<tr><td style="text-align:right"> Common liquids </td><td style="text-align:left"> 1.33 to 1.5 </td></tr>
<tr><td style="text-align:right"> Common gemstones </td><td style="text-align:left"> 1.58 to 2.33 </td></tr>
<tr><td style="text-align:right"> Plastics, glass </td><td style="text-align:left"> 1.5 to 1.58 </td></tr>
<tr><td style="text-align:right"> Other dielectric materials </td><td style="text-align:left"> 1.33 to 1.58 </td></tr>
</tbody></table><center><div class="tablecaption"><a class="target" name="table_commonmatior"> </a><b style="font-style:normal;">Table 6:</b> Index of refraction of common materials</div></center></div>
<p></p><p>
The appearance of a refractive material will greatly depend on the <code>refractionType</code> and
<code>refractionMode</code> settings of the material. Refer to section <a href="#toc4.2.20">4.2.20</a> and section <a href="#toc4.2.19">4.2.19</a>
for more information.
</p><p>
The effect of <code>ior</code> when <code>refractionMode</code> is set to <code>cubemap</code> and <code>refractionType</code> is set to <code>solid</code>
can be seen in <a href="#figure_iorproperty2">figure 21</a> (click on the image to see a larger version).
</p><p>
</p><center><div class="image" style=""><a href="images/materials/ior.png" target="_blank"><img class="markdeep" src="images/materials/ior.png"></a><center><span class="imagecaption"><a class="target" name="figure_iorproperty2"> </a><b style="font-style:normal;">Figure 21:</b> <code>transmission</code> varying from 1.0
(left) to 1.5 (right)</span></center></div></center>
<p></p><p>
<a href="#figure_iorproperty">Figure 22</a> shows the comparison of a sphere of <code>ior</code> 1.0 with a sphere of <code>ior</code> 1.33, with
the <code>refractionMode</code> set to <code>screenspace</code> and the <code>refractionType</code> set to <code>solid</code>
(click on the image to see a larger version).
</p><p>
</p><center><div class="image" style=""><a href="images/material_ior.png" target="_blank"><img class="markdeep" src="images/material_ior.png"></a><center><span class="imagecaption"><a class="target" name="figure_iorproperty"> </a><b style="font-style:normal;">Figure 22:</b> <code>ior</code> of 1.0 (left) and 1.33 (right)</span></center></div></center>
<p></p><p>
Note that the <code>ior</code> property also defines the reflectance (or specular intensity) of the surface.
When this property is defined it is not necessary to define the <code>reflectance</code> property. Setting
either of these properties will automatically compute the other property. It is possible to specify
both, in which case their values are kept as-is, which can lead to physically impossible materials,
however, this might be desirable for artistic reasons.
</p><p>
See the <a href="#reflectance">Reflectance</a> section for more information on the <code>reflectance</code> property.
</p><p>
</p><div class="admonition tip">Refractive materials are affected by the <code>roughness</code> property. Rough materials will scatter
light, creating a diffusion effect useful to recreate “blurry” appearances such as frosted
glass, certain plastics, etc.</div>
<p></p>
<a class="target" name="transmission"> </a><a class="target" name="materialmodels/litmodel/transmission"> </a><a class="target" name="toc3.1.21"> </a><h3>Transmission</h3>
<p>
The <code>transmission</code> property defines what ratio of diffuse light is transmitted through a refractive
material. This property only affects materials with a <code>refractionMode</code> set to <code>cubemap</code> or
<code>screenspace</code>.
</p><p>
When <code>transmission</code> is set to 0, no amount of light is transmitted and the diffuse component of
the surface is 100% visible. When <code>transmission</code> is set to 1, all the light is transmitted and the
diffuse component is not visible anymore, only the specular component is.
</p><p>
The effect of <code>transmission</code> on a glossy dielectric (<code>ior</code> of 1.5, <code>refractionMode</code> set to
<code>cubemap</code>, <code>refractionType</code> set to <code>solid</code>) is shown in <a href="#figure_transmissionproperty">figure 23</a>
(click on the image to see a larger version).
</p><p>
</p><center><div class="image" style=""><a href="images/materials/transmission.png" target="_blank"><img class="markdeep" src="images/materials/transmission.png"></a><center><span class="imagecaption"><a class="target" name="figure_transmissionproperty"> </a><b style="font-style:normal;">Figure 23:</b> <code>transmission</code> varying from 0.0
(left) to 1.0 (right)</span></center></div></center>
<p></p><p>
</p><div class="admonition tip">The <code>transmission</code> property is useful to create decals, paint, etc. at the surface of refractive
materials.</div>
<p></p>
<a class="target" name="absorption"> </a><a class="target" name="materialmodels/litmodel/absorption"> </a><a class="target" name="toc3.1.22"> </a><h3>Absorption</h3>
<p>
The <code>absorption</code> property defines the absorption coefficients of light transmitted through the
material. <a href="#figure_absorptionexample">Figure 24</a> shows the effect of <code>absorption</code> on a refracting object with
an index of refraction of 1.5 and a base color set to white.
</p><p>
</p><center><div class="image" style=""><a href="images/material_absorption.png" target="_blank"><img class="markdeep" src="images/material_absorption.png"></a><center><span class="imagecaption"><a class="target" name="figure_absorptionexample"> </a><b style="font-style:normal;">Figure 24:</b> Refracting object without (left)
and with (right) absorption</span></center></div></center>
<p></p><p>
Transmittance through a volume is exponential with respect to the optical depth (defined either
with <code>microThickness</code> or <code>thickness</code>). The computed color follows the following formula:
</p><p>
$$color \cdot e^{-absorption \cdot distance}$$
</p><p>
Where <code>distance</code> is either <code>microThickness</code> or <code>thickness</code>, that is the distance light will travel
through the material at a given point. If no thickness/distance is specified, the computed color
follows this formula instead:
</p><p>