summaryrefslogtreecommitdiff
path: root/doc/mtl-format.txt
blob: 13155b806e43d3ffa80b2b294dc5daf47e03e9c8 (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
                     MTL material format (Lightwave, OBJ)

                    Excerpt from FILE FORMATS, Version 4.2
                                 October 1995
      Documentation created by: Diane Ramey, Linda Rose, and Lisa Tyerman
                     Copyright 1995 Alias|Wavefront, Inc.
                              All rights reserved



5.  Material Library File (.mtl)

 Material library files contain one or more material definitions, each
of which includes the color, texture, and reflection map of individual
materials.  These are applied to the surfaces and vertices of objects.
Material files are stored in ASCII format and have the .mtl extension.

 An .mtl file differs from other Alias|Wavefront property files, such as
light and atmosphere files, in that it can contain more than one
material definition (other files contain the definition of only one
item).

 An .mtl file is typically organized as shown below.


        newmtl my_red
                Material color
                & illumination
                statements

                texture map
                statements

                reflection map
                statement

        newmtl my_blue
                Material color
                & illumination
                statements

                texture map
                statements

                reflection map
                statement

        newmtl my_green
                Material color
                & illumination
                statements

                texture map
                statements

                reflection map
                statement

        Figure 5-1.  Typical organization of .mtl file


 Each material description in an .mtl file consists of the newmtl
statement, which assigns a name to the material and designates the start
of a material description.  This statement is followed by the material
color, texture map, and reflection map statements that describe the
material.  An .mtl file map contain many different material
descriptions.

 After you specify a new material with the "newmtl" statement, you can
enter the statements that describe the materials in any order.  However,
when the Property Editor writes an .mtl file, it puts the statements in
a system-assigned order.  In this chapter, the statements are described
in the system-assigned order.


 Format

 The following is a sample format for a material definition in an .mtl
file:

 Material
 name
 statement:
                newmtl my_mtl

 Material
 color and
 illumination
 statements:
                Ka 0.0435 0.0435 0.0435
                Kd 0.1086 0.1086 0.1086
                Ks 0.0000 0.0000 0.0000
                Tf 0.9885 0.9885 0.9885
                illum 6
                d -halo 0.6600
                Ns 10.0000
                sharpness 60
                Ni 1.19713

 Texture
 map
 statements:
                map_Ka -s 1 1 1 -o 0 0 0 -mm 0 1 chrome.mpc
                map_Kd -s 1 1 1 -o 0 0 0 -mm 0 1 chrome.mpc
                map_Ks -s 1 1 1 -o 0 0 0 -mm 0 1 chrome.mpc
                map_Ns -s 1 1 1 -o 0 0 0 -mm 0 1 wisp.mps
                map_d -s 1 1 1 -o 0 0 0 -mm 0 1 wisp.mps
                disp -s 1 1 .5 wisp.mps
                decal -s 1 1 1 -o 0 0 0 -mm 0 1 sand.mps
                bump -s 1 1 1 -o 0 0 0 -bm 1 sand.mpb

 Reflection
 map
 statement:
                refl -type sphere -mm 0 1 clouds.mpc


 Material Name

 The material name statement assigns a name to the material description.

 Syntax
 The folowing syntax describes the material name statement.

        newmtl name

 Specifies the start of a material description and assigns a name to the
material.  An .mtl file must have one newmtl statement at the start of
each material description.

        "name" is the name of the material.  Names may be any length but
cannot include blanks.  Underscores may be used in material names.


 Material color and illumination

 The statements in this section specify color, transparency, and
reflectivity values.

 Syntax
 The following syntax describes the material color and illumination
statements that apply to all .mtl files.


        Ka r g b
        Ka spectral file.rfl factor
        Ka xyz x y z

 To specify the ambient reflectivity of the current material, you can
use the "Ka" statement, the "Ka spectral" statement, or the "Ka xyz"
statement.

 Tip    These statements are mutually exclusive.  They cannot be used
concurrently in the same material.

 Ka r g b

 The Ka statement specifies the ambient reflectivity using RGB values.

 "r g b" are the values for the red, green, and blue components of the
color.  The g and b arguments are optional.  If only r is specified,
then g, and b are assumed to be equal to r.  The r g b values are
normally in the range of 0.0 to 1.0.  Values outside this range increase
or decrease the relectivity accordingly.

 Ka spectral file.rfl factor

 The "Ka spectral" statement specifies the ambient reflectivity using a
spectral curve.

 "file.rfl" is the name of the .rfl file.
 "factor" is an optional argument.
 "factor" is a multiplier for the values in the .rfl file and defaults
to 1.0, if not specified.

 Ka xyz x y z

 The "Ka xyz" statement specifies the ambient reflectivity using CIEXYZ
values.

 "x y z" are the values of the CIEXYZ color space.  The y and z
arguments are optional.  If only x is specified, then y and z are
assumed to be equal to x.  The x y z values are normally in the range of
0 to 1.  Values outside this range increase or decrease the reflectivity
accordingly.


        Kd r g b
        Kd spectral file.rfl factor
        Kd xyz x y z

 To specify the diffuse reflectivity of the current material, you can
use the "Kd" statement, the "Kd spectral" statement, or the "Kd xyz"
statement.

 Tip    These statements are mutually exclusive.  They cannot be used
concurrently in the same material.

 Kd r g b

 The Kd statement specifies the diffuse reflectivity using RGB values.

 "r g b" are the values for the red, green, and blue components of the
atmosphere.  The g and b arguments are optional.  If only r is
specified, then g, and b are assumed to be equal to r.  The r g b values
are normally in the range of 0.0 to 1.0.  Values outside this range
increase or decrease the relectivity accordingly.

 Kd spectral file.rfl factor

 The "Kd spectral" statement specifies the diffuse reflectivity using a
spectral curve.

 "file.rfl" is the name of the .rfl file.
 "factor" is an optional argument.
 "factor" is a multiplier for the values in the .rfl file and defaults
to 1.0, if not specified.

 Kd xyz x y z

 The "Kd xyz" statement specifies the diffuse reflectivity using CIEXYZ
values.

 "x y z" are the values of the CIEXYZ color space.  The y and z
arguments are optional.  If only x is specified, then y and z are
assumed to be equal to x.  The x y z values are normally in the range of
0 to 1.  Values outside this range increase or decrease the reflectivity
accordingly.


        Ks r g b
        Ks spectral file.rfl factor
        Ks xyz x y z

 To specify the specular reflectivity of the current material, you can
use the "Ks" statement, the "Ks spectral" statement, or the "Ks xyz"
statement.

 Tip    These statements are mutually exclusive.  They cannot be used
concurrently in the same material.

 Ks r g b

 The Ks statement specifies the specular reflectivity using RGB values.

 "r g b" are the values for the red, green, and blue components of the
atmosphere.  The g and b arguments are optional.  If only r is
specified, then g, and b are assumed to be equal to r.  The r g b values
are normally in the range of 0.0 to 1.0.  Values outside this range
increase or decrease the relectivity accordingly.

 Ks spectral file.rfl factor

 The "Ks spectral" statement specifies the specular reflectivity using a
spectral curve.

 "file.rfl" is the name of the .rfl file.
 "factor" is an optional argument.
 "factor" is a multiplier for the values in the .rfl file and defaults
to 1.0, if not specified.

 Ks xyz x y z

 The "Ks xyz" statement specifies the specular reflectivity using CIEXYZ
values.

 "x y z" are the values of the CIEXYZ color space.  The y and z
arguments are optional.  If only x is specified, then y and z are
assumed to be equal to x.  The x y z values are normally in the range of
0 to 1.  Values outside this range increase or decrease the reflectivity
accordingly.


        Tf r g b
        Tf spectral file.rfl factor
        Tf xyz x y z

 To specify the transmission filter of the current material, you can use
the "Tf" statement, the "Tf spectral" statement, or the "Tf xyz"
statement.

 Any light passing through the object is filtered by the transmission
filter, which only allows the specifiec colors to pass through.  For
example, Tf 0 1 0 allows all the green to pass through and filters out
all the red and blue.

 Tip    These statements are mutually exclusive.  They cannot be used
concurrently in the same material.

 Tf r g b

 The Tf statement specifies the transmission filter using RGB values.

 "r g b" are the values for the red, green, and blue components of the
atmosphere.  The g and b arguments are optional.  If only r is
specified, then g, and b are assumed to be equal to r.  The r g b values
are normally in the range of 0.0 to 1.0.  Values outside this range
increase or decrease the relectivity accordingly.

 Tf spectral file.rfl factor

 The "Tf spectral" statement specifies the transmission filterusing a
spectral curve.

 "file.rfl" is the name of the .rfl file.
 "factor" is an optional argument.
 "factor" is a multiplier for the values in the .rfl file and defaults
to 1.0, if not specified.

 Tf xyz x y z

 The "Ks xyz" statement specifies the specular reflectivity using CIEXYZ
values.

 "x y z" are the values of the CIEXYZ color space.  The y and z
arguments are optional.  If only x is specified, then y and z are
assumed to be equal to x.  The x y z values are normally in the range of
0 to 1.  Values outside this range will increase or decrease the
intensity of the light transmission accordingly.


 illum illum_#

 The "illum" statement specifies the illumination model to use in the
material.  Illumination models are mathematical equations that represent
various material lighting and shading effects.

 "illum_#"can be a number from 0 to 10.  The illumination models are
summarized below; for complete descriptions see "Illumination models" on
page 5-30.

 Illumination    Properties that are turned on in the
 model           Property Editor

 0              Color on and Ambient off
 1              Color on and Ambient on
 2              Highlight on
 3              Reflection on and Ray trace on
 4              Transparency: Glass on
                Reflection: Ray trace on
 5              Reflection: Fresnel on and Ray trace on
 6              Transparency: Refraction on
                Reflection: Fresnel off and Ray trace on
 7              Transparency: Refraction on
                Reflection: Fresnel on and Ray trace on
 8              Reflection on and Ray trace off
 9              Transparency: Glass on
                Reflection: Ray trace off
 10             Casts shadows onto invisible surfaces


 d factor

 Specifies the dissolve for the current material.

 "factor" is the amount this material dissolves into the background.  A
factor of 1.0 is fully opaque.  This is the default when a new material
is created.  A factor of 0.0 is fully dissolved (completely
transparent).

 Unlike a real transparent material, the dissolve does not depend upon
material thickness nor does it have any spectral character.  Dissolve
works on all illumination models.

 d -halo factor

 Specifies that a dissolve is dependent on the surface orientation
relative to the viewer.  For example, a sphere with the following
dissolve, d -halo 0.0, will be fully dissolved at its center and will
appear gradually more opaque toward its edge.

 "factor" is the minimum amount of dissolve applied to the material.
The amount of dissolve will vary between 1.0 (fully opaque) and the
specified "factor".  The formula is:

 dissolve = 1.0 - (N*v)(1.0-factor)

 For a definition of terms, see "Illumination models" on page 5-30.


 Ns exponent

 Specifies the specular exponent for the current material.  This defines
the focus of the specular highlight.

 "exponent" is the value for the specular exponent.  A high exponent
results in a tight, concentrated highlight.  Ns values normally range
from 0 to 1000.


 sharpness value

 Specifies the sharpness of the reflections from the local reflection
map.  If a material does not have a local reflection map defined in its
material definition, sharpness will apply to the global reflection map
defined in PreView.

 "value" can be a number from 0 to 1000.  The default is 60.  A high
value results in a clear reflection of objects in the reflection map.

 Tip    Sharpness values greater than 100 map introduce aliasing effects
in flat surfaces that are viewed at a sharp angle


 Ni optical_density

 Specifies the optical density for the surface.  This is also known as
index of refraction.

 "optical_density" is the value for the optical density.  The values can
range from 0.001 to 10.  A value of 1.0 means that light does not bend
as it passes through an object.  Increasing the optical_density
increases the amount of bending.  Glass has an index of refraction of
about 1.5.  Values of less than 1.0 produce bizarre results and are not
recommended.


 Material texture map

 Texture map statements modify the material parameters of a surface by
associating an image or texture file with material parameters that can
be mapped.  By modifying existing parameters instead of replacing them,
texture maps provide great flexibility in changing the appearance of an
object's surface.

 Image files and texture files can be used interchangeably.  If you use
an image file, that file is converted to a texture in memory and is
discarded after rendering.

 Tip Using images instead of textures saves disk space and setup time,
however, it introduces a small computational cost at the beginning of a
render.

 The material parameters that can be modified by a texture map are:

 - Ka (color)
 - Kd (color)
 - Ks (color)
 - Ns (scalar)
 - d (scalar)

 In addition to the material parameters, the surface normal can be
modified.


 Image file types

 You can link any image file type that is currently supported.
Supported image file types are listed in the chapter "About Image" in
the "Advanced Visualizer User's Guide".  You can also use the "im_info -
a" command to list Image file types, among other things.


 Texture file types

 The texture file types you can use are:

 - mip-mapped texture files (.mpc, .mps, .mpb)
 - compiled procedural texture files (.cxc, .cxs, .cxb)


 Mip-mapped texture files

 Mip-mapped texture files are created from images using the Create
Textures panel in the Director or the "texture2D" program.  There are
three types of texture files:

 - color texture files (.mpc)
 - scalar texture files (.mps)
 - bump texture files (.mpb)

 Color textures.  Color texture files are designated by an extension of
".mpc" in the filename, such as "chrome.mpc".  Color textures modify the
material color as follows:

 - Ka - material ambient is multiplied by the texture value
 - Kd - material diffuse is multiplied by the texture value
 - Ks - material specular is multiplied by the texture value

 Scalar textures.  Scalar texture files are designated by an extension
of ".mps" in the filename, such as "wisp.mps".  Scalar textures modify
the material scalar values as follows:

 - Ns - material specular exponent is multiplied by the texture value
 - d - material dissolve is multiplied by the texture value
 - decal - uses a scalar value to deform the surface of an object to
create surface roughness

 Bump textures.  Bump texture files are designated by an extension of
".mpb" in the filename, such as "sand.mpb".  Bump textures modify
surface normals.  The image used for a bump texture represents the
topology or height of the surface relative to the average surface.  Dark
areas are depressions and light areas are high points.  The effect is
like embossing the surface with the texture.


 Procedural texture files

 Procedural texture files use mathematical formulas to calculate sample
values of the texture.  The procedural texture file is compiled, stored,
and accessed by the Image program when rendering.  for more information
see chapter 9, "Procedural Texture Files (.cxc, .cxb. and .cxs)".

 Syntax

 The following syntax describes the texture map statements that apply to
.mtl files.  These statements can be used alone or with any combination
of options.  The options and their arguments are inserted between the
keyword and the "filename".

 map_Ka -options args filename

 Specifies that a color texture file or a color procedural texture file
is applied to the ambient reflectivity of the material.  During
rendering, the "map_Ka" value is multiplied by the "Ka" value.

 "filename" is the name of a color texture file (.mpc), a color
procedural texture file (.cxc), or an image file.

 Tip    To make sure that the texture retains its original look, use the
.rfl file "ident" as the underlying material.  This applies to the
"map_Ka", "map_Kd", and "map_Ks" statements.  For more information on
.rfl files, see chapter 8, "Spectral Curve File (.rfl)".

 The options for the "map_Ka" statement are listed below.  These options
are described in detail in "Options for texture map statements" on page
5-18.

        -blendu on | off
        -blendv on | off
        -cc on | off
        -clamp on | off
        -mm base gain
        -o u v w
        -s u v w
        -t u v w
        -texres value


 map_Kd -options args filename

 Specifies that a color texture file or color procedural texture file is
linked to the diffuse reflectivity of the material.  During rendering,
the map_Kd value is multiplied by the Kd value.

 "filename" is the name of a color texture file (.mpc), a color
procedural texture file (.cxc), or an image file.

 The options for the map_Kd statement are listed below.  These options
are described in detail in "Options for texture map statements" on page
5-18.

        -blendu on | off
        -blendv on | off
        -cc on | off
        -clamp on | off
        -mm base gain
        -o u v w
        -s u v w
        -t u v w
        -texres value


 map_Ks -options args filename

 Specifies that a color texture file or color procedural texture file is
linked to the specular reflectivity of the material.  During rendering,
the map_Ks value is multiplied by the Ks value.

 "filename" is the name of a color texture file (.mpc), a color
procedural texture file (.cxc), or an image file.

 The options for the map_Ks statement are listed below.  These options
are described in detail in "Options for texture map statements" on page
5-18.

        -blendu on | off
        -blendv on | off
        -cc on | off
        -clamp on | off
        -mm base gain
        -o u v w
        -s u v w
        -t u v w
        -texres value


 map_Ns -options args filename

 Specifies that a scalar texture file or scalar procedural texture file
is linked to the specular exponent of the material.  During rendering,
the map_Ns value is multiplied by the Ns value.

 "filename" is the name of a scalar texture file (.mps), a scalar
procedural texture file (.cxs), or an image file.

 The options for the map_Ns statement are listed below.  These options
are described in detail in "Options for texture map statements" on page
5-18.

        -blendu on | off
        -blendv on | off
        -clamp on | off
        -imfchan r | g | b | m | l | z
        -mm base gain
        -o u v w
        -s u v w
        -t u v w
        -texres value


 map_d -options args filename

 Specifies that a scalar texture file or scalar procedural texture file
is linked to the dissolve of the material.  During rendering, the map_d
value is multiplied by the d value.

 "filename" is the name of a scalar texture file (.mps), a scalar
procedural texture file (.cxs), or an image file.

 The options for the map_d statement are listed below.  These options
are described in detail in "Options for texture map statements" on page
5-18.

        -blendu on | off
        -blendv on | off
        -clamp on | off
        -imfchan r | g | b | m | l | z
        -mm base gain
        -o u v w
        -s u v w
        -t u v w
        -texres value


 map_aat on

 Turns on anti-aliasing of textures in this material without anti-
aliasing all textures in the scene.

 If you wish to selectively anti-alias textures, first insert this
statement in the material file.  Then, when rendering with the Image
panel, choose the anti-alias settings:  "shadows", "reflections
polygons", or "polygons only".  If using Image from the command line,
use the -aa or -os options.  Do not use the -aat option.

 Image will anti-alias all textures in materials with the map_aat on
statement, using the oversampling level you choose when you run Image.
Textures in other materials will not be oversampled.

 You cannot set a different oversampling level individually for each
material, nor can you anti-alias some textures in a material and not
others.  To anti-alias all textures in all materials, use the -aat
option from the Image command line.  If a material with "map_aat on"
includes a reflection map, all textures in that reflection map will be
anti-aliased as well.

 You will not see the effects of map_aat in the Property Editor.

 Tip    Some .mpc textures map exhibit undesirable effects around the
edges of smoothed objects.  The "map_aat" statement will correct this.


 decal -options args filename

 Specifies that a scalar texture file or a scalar procedural texture
file is used to selectively replace the material color with the texture
color.

 "filename" is the name of a scalar texture file (.mps), a scalar
procedural texture file (.cxs), or an image file.

 During rendering, the Ka, Kd, and Ks values and the map_Ka, map_Kd, and
map_Ks values are blended according to the following formula:

 result_color=tex_color(tv)*decal(tv)+mtl_color*(1.0-decal(tv))

 where tv is the texture vertex.

 "result_color" is the blended Ka, Kd, and Ks values.

 The options for the decal statement are listed below.  These options
are described in detail in "Options for texture map statements" on page
5-18.

        -blendu on | off
        -blendv on | off
        -clamp on | off
        -imfchan r | g | b | m | l | z
        -mm base gain
        -o u v w
        -s u v w
        -t u v w
        -texres value


 disp -options args filename

 Specifies that a scalar texture is used to deform the surface of an
object, creating surface roughness.

 "filename" is the name of a scalar texture file (.mps), a bump
procedural texture file (.cxb), or an image file.

 The options for the disp statement are listed below.  These options are
described in detail in "Options for texture map statements" on page 5-
18.

        -blendu on | off
        -blendv on | off
        -clamp on | off
        -imfchan r | g | b | m | l | z
        -mm base gain
        -o u v w
        -s u v w
        -t u v w
        -texres value


 bump -options args filename

 Specifies that a bump texture file or a bump procedural texture file is
linked to the material.

 "filename" is the name of a bump texture file (.mpb), a bump procedural
texture file (.cxb), or an image file.

 The options for the bump statement are listed below.  These options are
described in detail in "Options for texture map statements" on page 5-
18.

        -bm mult
        -clamp on | off
        -blendu on | off
        -blendv on | off
        -imfchan r | g | b | m | l | z
        -mm base gain
        -o u v w
        -s u v w
        -t u v w
        -texres value


 Options for texture map statements

 The following options and arguments can be used to modify the texture
map statements.

 -blenu on | off

 The -blendu option turns texture blending in the horizontal direction
(u direction) on or off.  The default is on.

 -blenv on | off

 The -blendv option turns texture blending in the vertical direction (v
direction) on or off.  The default is on.

 -bm mult

 The -bm option specifies a bump multiplier.  You can use it only with
the "bump" statement.  Values stored with the texture or procedural
texture file are multiplied by this value before they are applied to the
surface.

 "mult" is the value for the bump multiplier.  It can be positive or
negative.  Extreme bump multipliers may cause odd visual results because
only the surface normal is perturbed and the surface position does not
change.  For best results, use values between 0 and 1.

 -boost value

 The -boost option increases the sharpness, or clarity, of mip-mapped
texture files -- that is, color (.mpc), scalar (.mps), and bump (.mpb)
files.  If you render animations with boost, you may experience some
texture crawling.  The effects of boost are seen when you render in
Image or test render in Model or PreView; they aren't as noticeable in
Property Editor.

 "value" is any non-negative floating point value representing the
degree of increased clarity; the greater the value, the greater the
clarity.  You should start with a boost value of no more than 1 or 2 and
increase the value as needed.  Note that larger values have more
potential to introduce texture crawling when animated.

 -cc on | off

 The -cc option turns on color correction for the texture.  You can use
it only with the color map statements:  map_Ka, map_Kd, and map_Ks.

 -clamp on | off

 The -clamp option turns clamping on or off.  When clamping is on,
textures are restricted to 0-1 in the uvw range.  The default is off.

 When clamping is turned on, one copy of the texture is mapped onto the
surface, rather than repeating copies of the original texture across the
surface of a polygon, which is the default.  Outside of the origin
texture, the underlying material is unchanged.

 A postage stamp on an envelope or a label on a can of soup is an
example of a texture with clamping turned on.  A tile floor or a
sidewalk is an example of a texture with clamping turned off.

 Two-dimensional textures are clamped in the u and v dimensions; 3D
procedural textures are clamped in the u, v, and w dimensions.

 -imfchan r | g | b | m | l | z

 The -imfchan option specifies the channel used to create a scalar or
bump texture.  Scalar textures are applied to:

 transparency
 specular exponent
 decal
 displacement

 The channel choices are:

 r specifies the red channel.
 g specifies the green channel.
 b specifies the blue channel.
 m specifies the matte channel.
 l specifies the luminance channel.
 z specifies the z-depth channel.

 The default for bump and scalar textures is "l" (luminance), unless you
are building a decal.  In that case, the default is "m" (matte).

 -mm base gain

 The -mm option modifies the range over which scalar or color texture
values may vary.  This has an effect only during rendering and does not
change the file.

 "base" adds a base value to the texture values.  A positive value makes
everything brighter; a negative value makes everything dimmer.  The
default is 0; the range is unlimited.

 "gain" expands the range of the texture values.  Increasing the number
increases the contrast.  The default is 1; the range is unlimited.

 -o u v w

 The -o option offsets the position of the texture map on the surface by
shifting the position of the map origin.  The default is 0, 0, 0.

 "u" is the value for the horizontal direction of the texture

 "v" is an optional argument.
 "v" is the value for the vertical direction of the texture.

 "w" is an optional argument.
 "w" is the value used for the depth of a 3D texture.

 -s u v w

 The -s option scales the size of the texture pattern on the textured
surface by expanding or shrinking the pattern.  The default is 1, 1, 1.

 "u" is the value for the horizontal direction of the texture

 "v" is an optional argument.
 "v" is the value for the vertical direction of the texture.

 "w" is an optional argument.
 "w" is a value used for the depth of a 3D texture.
 "w" is a value used for the amount of tessellation of the displacement
map.

 -t u v w

 The -t option turns on turbulence for textures.  Adding turbulence to a
texture along a specified direction adds variance to the original image
and allows a simple image to be repeated over a larger area without
noticeable tiling effects.

 turbulence also lets you use a 2D image as if it were a solid texture,
similar to 3D procedural textures like marble and granite.

 "u" is the value for the horizontal direction of the texture
turbulence.

 "v" is an optional argument.
 "v" is the value for the vertical direction of the texture turbulence.

 "w" is an optional argument.
 "w" is a value used for the depth of the texture turbulence.

 By default, the turbulence for every texture map used in a material is
uvw = (0,0,0).  This means that no turbulence will be applied and the 2D
texture will behave normally.

 Only when you raise the turbulence values above zero will you see the
effects of turbulence.

 -texres resolution

 The -texres option specifies the resolution of texture created when an
image is used.  The default texture size is the largest power of two
that does not exceed the original image size.

 If the source image is an exact power of 2, the texture cannot be built
any larger.  If the source image size is not an exact power of 2, you
can specify that the texture be built at the next power of 2 greater
than the source image size.

 The original image should be square, otherwise, it will be scaled to
fit the closest square size that is not larger than the original.
Scaling reduces sharpness.


 Material reflection map

 A reflection map is an environment that simulates reflections in
specified objects.  The environment is represented by a color texture
file or procedural texture file that is mapped on the inside of an
infinitely large, space.  Reflection maps can be spherical or cubic.  A
spherical reflection map requires only one texture or image file, while
a cubic reflection map requires six.

 Each material description can contain one reflection map statement that
specifies a color texture file or a color procedural texture file to
represent the environment.  The material itself must be assigned an
illumination model of 3 or greater.

 The reflection map statement in the .mtl file defines a local
reflection map.  That is, each material assigned to an object in a scene
can have an individual reflection map.  In PreView, you can assign a
global reflection map to an object and specify the orientation of the
reflection map.  Rotating the reflection map creates the effect of
animating reflections independently of object motion.  When you replace
a global reflection map with a local reflection map, the local
reflection map inherits the transformation of the global reflection map.

 Syntax

 The following syntax statements describe the reflection map statement
for .mtl files.

 refl -type sphere -options -args filename

 Specifies an infinitely large sphere that casts reflections onto the
material.  You specify one texture file.

 "filename" is the color texture file, color procedural texture file, or
image file that will be mapped onto the inside of the shape.

 refl -type cube_side -options -args filenames

 Specifies an infinitely large sphere that casts reflections onto the
material.  You can specify different texture files for the "top",
"bottom", "front", "back", "left", and "right" with the following
statements:

 refl -type cube_top
 refl -type cube_bottom
 refl -type cube_front
 refl -type cube_back
 refl -type cube_left
 refl -type cube_right

 "filenames" are the color texture files, color procedural texture
files, or image files that will be mapped onto the inside of the shape.

 The "refl" statements for sphere and cube can be used alone or with
 any combination of the following options.  The options and their
arguments are inserted between "refl" and "filename".

 -blendu on | off
 -blendv on | off
 -cc on | off
 -clamp on | off
 -mm base gain
 -o u v w
 -s u v w
 -t u v w
 -texres value

 The options for the reflection map statement are described in detail in
"Options for texture map statements" on page 18.


 Examples

 1  Neon green

 This is a bright green material.  When applied to an object, it will
remain bright green regardless of any lighting in the scene.

 newmtl neon_green
 Kd 0.0000 1.0000 0.0000
 illum 0

 2  Flat green

 This is a flat green material.

 newmtl flat_green
 Ka 0.0000 1.0000 0.0000
 Kd 0.0000 1.0000 0.0000
 illum 1

 3  Dissolved green

 This is a flat green, partially dissolved material.

 newmtl diss_green
 Ka 0.0000 1.0000 0.0000
 Kd 0.0000 1.0000 0.0000
 d 0.8000
 illum 1

 4  Shiny green

 This is a shiny green material.  When applied to an object, it shows a
white specular highlight.

 newmtl shiny_green
 Ka 0.0000 1.0000 0.0000
 Kd 0.0000 1.0000 0.0000
 Ks 1.0000 1.0000 1.0000
 Ns 200.0000
 illum 1

 5  Green mirror

 This is a reflective green material.  When applied to an object, it
reflects other objects in the same scene.

 newmtl green_mirror
 Ka 0.0000 1.0000 0.0000
 Kd 0.0000 1.0000 0.0000
 Ks 0.0000 1.0000 0.0000
 Ns 200.0000
 illum 3

 6  Fake windshield

 This material approximates a glass surface.  Is it almost completely
transparent, but it shows reflections of other objects in the scene.  It
will not distort the image of objects seen through the material.

 newmtl fake_windsh
 Ka 0.0000 0.0000 0.0000
 Kd 0.0000 0.0000 0.0000
 Ks 0.9000 0.9000 0.9000
 d 0.1000
 Ns 200
 illum 4

 7  Fresnel blue

 This material exhibits an effect known as Fresnel reflection.  When
applied to an object, white fringes may appear where the object's
surface is viewed at a glancing angle.

 newmtl fresnel_blu
 Ka 0.0000 0.0000 0.0000
 Kd 0.0000 0.0000 0.0000
 Ks 0.6180 0.8760 0.1430
 Ns 200
 illum 5

 8  Real windshield

 This material accurately represents a glass surface.  It filters of
colorizes objects that are seen through it.  Filtering is done according
to the transmission color of the material.  The material also distorts
the image of objects according to its optical density.  Note that the
material is not dissolved and that its ambient, diffuse, and specular
reflective colors have been set to black.  Only the transmission color
is non-black.

 newmtl real_windsh
 Ka 0.0000 0.0000 0.0000
 Kd 0.0000 0.0000 0.0000
 Ks 0.0000 0.0000 0.0000
 Tf 1.0000 1.0000 1.0000
 Ns 200
 Ni 1.2000
 illum 6

 9  Fresnel windshield

 This material combines the effects in examples 7 and 8.

 newmtl fresnel_win
 Ka 0.0000 0.0000 1.0000
 Kd 0.0000 0.0000 1.0000
 Ks 0.6180 0.8760 0.1430
 Tf 1.0000 1.0000 1.0000
 Ns 200
 Ni 1.2000
 illum 7

 10  Tin

 This material is based on spectral reflectance samples taken from an
actual piece of tin.  These samples are stored in a separate .rfl file
that is referred to by name in the material.  Spectral sample files
(.rfl) can be used in any type of material as an alternative to RGB
values.

 newmtl tin
 Ka spectral tin.rfl
 Kd spectral tin.rfl
 Ks spectral tin.rfl
 Ns 200
 illum 3

 11  Pine Wood

 This material includes a texture map of a pine pattern.  The material
color is set to "ident" to preserve the texture's true color.  When
applied to an object, this texture map will affect only the ambient and
diffuse regions of that object's surface.

 The color information for the texture is stored in a separate .mpc file
that is referred to in the material by its name, "pine.mpc".  If you use
different .mpc files for ambient and diffuse, you will get unrealistic
results.

 newmtl pine_wood
 Ka spectral ident.rfl 1
 Kd spectral ident.rfl 1
 illum 1
 map_Ka pine.mpc
 map_Kd pine.mpc

 12  Bumpy leather

 This material includes a texture map of a leather pattern.  The
material color is set to "ident" to preserve the texture's true color.
When applied to an object, it affects both the color of the object's
surface and its apparent bumpiness.

 The color information for the texture is stored in a separate .mpc file
that is referred to in the material by its name, "brown.mpc".  The bump
information is stored in a separate .mpb file that is referred to in the
material by its name, "leath.mpb".  The -bm option is used to raise the
apparent height of the leather bumps.

 newmtl bumpy_leath
 Ka spectral ident.rfl 1
 Kd spectral ident.rfl 1
 Ks spectral ident.rfl 1
 illum 2
 map_Ka brown.mpc
 map_Kd brown.mpc
 map_Ks brown.mpc
 bump -bm 2.000 leath.mpb

 13  Frosted window

 This material includes a texture map used to alter the opacity of an
object's surface.  The material color is set to "ident" to preserve the
texture's true color.  When applied to an object, the object becomes
transparent in certain areas and opaque in others.

 The variation between opaque and transparent regions is controlled by
scalar information stored in a separate .mps file that is referred to in
the material by its name, "window.mps".  The "-mm" option is used to
shift and compress the range of opacity.

 newmtl frost_wind
 Ka 0.2 0.2 0.2
 Kd 0.6 0.6 0.6
 Ks 0.1 0.1 0.1
 d 1
 Ns 200
 illum 2
 map_d -mm 0.200 0.800 window.mps

 14  Shifted logo

 This material includes a texture map which illustrates how a texture's
origin may be shifted left/right (the "u" direction) or up/down (the "v"
direction).  The material color is set to "ident" to preserve the
texture's true color.

 In this example, the original image of the logo is off-center to the
left.  To compensate, the texture's origin is shifted back to the right
(the positive "u" direction) using the "-o" option to modify the origin.

 Ka spectral ident.rfl 1
 Kd spectral ident.rfl 1
 Ks spectral ident.rfl 1
 illum 2
 map_Ka -o 0.200 0.000 0.000 logo.mpc
 map_Kd -o 0.200 0.000 0.000 logo.mpc
 map_Ks -o 0.200 0.000 0.000 logo.mpc

 15  Scaled logo

 This material includes a texture map showing how a texture may be
scaled left or right (in the "u" direction) or up and down (in the "v"
direction).  The material color is set to "ident" to preserve the
texture's true color.

 In this example, the original image of the logo is too small.  To
compensate, the texture is scaled slightly to the right (in the positive
"u" direction) and up (in the positive "v" direction) using the "-s"
option to modify the scale.

 Ka spectral ident.rfl 1
 Kd spectral ident.rfl 1
 Ks spectral ident.rfl 1
 illum 2
 map_Ka -s 1.200 1.200 0.000 logo.mpc
 map_Kd -s 1.200 1.200 0.000 logo.mpc
 map_Ks -s 1.200 1.200 0.000 logo.mpc

 16  Chrome with spherical reflection map

 This illustrates a common use for local reflection maps (defined in a
material).

 this material is highly reflective with no diffuse or ambient
contribution.  Its reflection map is an image with silver streaks that
yields a chrome appearance when viewed as a reflection.

 ka 0 0 0
 kd 0 0 0
 ks .7 .7 .7
 illum 1
 refl -type sphere chrome.rla


 Illumination models

 The following list defines the terms and vectors that are used in the
illumination model equations:

 Term   Definition

 Ft     Fresnel reflectance
 Ft     Fresnel transmittance
 Ia     ambient light
 I      light intensity
 Ir     intensity from reflected direction
        (reflection map and/or ray tracing)
 It     intensity from transmitted direction
 Ka     ambient reflectance
 Kd     diffuse reflectance
 Ks     specular reflectance
 Tf     transmission filter

 Vector Definition

 H      unit vector bisector between L and V
 L      unit light vector
 N      unit surface normal
 V      unit view vector

 The illumination models are:

 0  This is a constant color illumination model.  The color is the
specified Kd for the material.  The formula is:

   color = Kd

 1  This is a diffuse illumination model using Lambertian shading. The
color includes an ambient constant term and a diffuse shading term for
each light source.  The formula is

   color = KaIa + Kd { SUM j=1..ls, (N * Lj)Ij }

 2  This is a diffuse and specular illumination model using Lambertian
shading and Blinn's interpretation of Phong's specular illumination
model (BLIN77).  The color includes an ambient constant term, and a
diffuse and specular shading term for each light source.  The formula
is:

   color = KaIa
        + Kd { SUM j=1..ls, (N*Lj)Ij }
        + Ks { SUM j=1..ls, ((H*Hj)^Ns)Ij }

 3  This is a diffuse and specular illumination model with reflection
using Lambertian shading, Blinn's interpretation of Phong's specular
illumination model (BLIN77), and a reflection term similar to that in
Whitted's illumination model (WHIT80).  The color includes an ambient
constant term and a diffuse and specular shading term for each light
source.  The formula is:

   color = KaIa
        + Kd { SUM j=1..ls, (N*Lj)Ij }
        + Ks ({ SUM j=1..ls, ((H*Hj)^Ns)Ij } + Ir)

   Ir = (intensity of reflection map) + (ray trace)

 4  The diffuse and specular illumination model used to simulate glass
is the same as illumination model 3.  When using a very low dissolve
(approximately 0.1), specular highlights from lights or reflections
become imperceptible.

 Simulating glass requires an almost transparent object that still
reflects strong highlights.  The maximum of the average intensity of
highlights and reflected lights is used to adjust the dissolve factor.
The formula is:

   color = KaIa
        + Kd { SUM j=1..ls, (N*Lj)Ij }
        + Ks ({ SUM j=1..ls, ((H*Hj)^Ns)Ij } + Ir)

 5  This is a diffuse and specular shading models similar to
illumination model 3, except that reflection due to Fresnel effects is
introduced into the equation.  Fresnel reflection results from light
striking a diffuse surface at a grazing or glancing angle.  When light
reflects at a grazing angle, the Ks value approaches 1.0 for all color
samples.  The formula is:

   color = KaIa
        + Kd { SUM j=1..ls, (N*Lj)Ij }
        + Ks ({ SUM j=1..ls, ((H*Hj)^Ns)Ij Fr(Lj*Hj,Ks,Ns)Ij} +
Fr(N*V,Ks,Ns)Ir})


 6  This is a diffuse and specular illumination model similar to that
used by Whitted (WHIT80) that allows rays to refract through a surface.
The amount of refraction is based on optical density (Ni).  The
intensity of light that refracts is equal to 1.0 minus the value of Ks,
and the resulting light is filtered by Tf (transmission filter) as it
passes through the object.  The formula is:

   color = KaIa
        + Kd { SUM j=1..ls, (N*Lj)Ij }
        + Ks ({ SUM j=1..ls, ((H*Hj)^Ns)Ij } + Ir)
        + (1.0 - Ks) TfIt

 7  This illumination model is similar to illumination model 6, except
that reflection and transmission due to Fresnel effects has been
introduced to the equation.  At grazing angles, more light is reflected
and less light is refracted through the object.  The formula is:

   color = KaIa
        + Kd { SUM j=1..ls, (N*Lj)Ij }
        + Ks ({ SUM j=1..ls, ((H*Hj)^Ns)Ij Fr(Lj*Hj,Ks,Ns)Ij} +
Fr(N*V,Ks,Ns)Ir})

        + (1.0 - Kx)Ft (N*V,(1.0-Ks),Ns)TfIt

 8  This illumination model is similar to illumination model 3 without
ray tracing.  The formula is:

   color = KaIa
        + Kd { SUM j=1..ls, (N*Lj)Ij }
        + Ks ({ SUM j=1..ls, ((H*Hj)^Ns)Ij } + Ir)

   Ir = (intensity of reflection map)

 9  This illumination model is similar to illumination model 4 without
ray tracing.  The formula is:


   color = KaIa
        + Kd { SUM j=1..ls, (N*Lj)Ij }
        + Ks ({ SUM j=1..ls, ((H*Hj)^Ns)Ij } + Ir)

   Ir = (intensity of reflection map)

 10  This illumination model is used to cast shadows onto an invisible
surface.  This is most useful when compositing computer-generated
imagery onto live action, since it allows shadows from rendered objects
to be composited directly on top of video-grabbed images.  The equation
for computation of a shadowmatte is formulated as follows.

 color = Pixel color.  The pixel color of a shadowmatte material is
always black.

 color = black

 M = Matte channel value.  This is the image channel which typically
represents the opacity of the point on the surface.  To store the shadow
in the matte channel of the image, it is calculated as:

 M = 1 - W / P

 where:

 P = Unweighted sum.  This is the sum of all S values for each light:

 P = S1 + S2 + S3 + .....

 W = Weighted sum.  This is the sum of all S values, each weighted by
the visibility factor (Q) for the light:

 W = (S1 * Q1) + (S2 * Q2) + .....

 Q = Visibility factor.  This is the amount of light from a particular
light source that reaches the point to be shaded, after traveling
through all shadow objects between the light and the point on the
surface.  Q = 0 means no light reached the point to be shaded; it was
blocked by shadow objects, thus casting a shadow.  Q = 1 means that
nothing blocked the light, and no shadow was cast.  0 < Q < 1 means that
the light was partially blocked by objects that were partially
dissolved.

 S = Summed brightness.  This is the sum of the spectral sample
intensities for a particular light.  The samples are variable, but the
default is 3:

 S = samp1 + samp2 + samp3.