Each material is an AFFF chunk (lib3ds MAT_ENTRY) in the
3D editor chunk. It has no data of its own; its
sub-chunks set the name, colours, shading and texture maps. Meshes name the materials
they use in their material group
chunks. The same chunks make up a material library (.mli) file.
Name, colours and percentages
| ID | Name | Data | Meaning |
|---|---|---|---|
A000 | MAT_NAME | strz | Material name |
A010 | MAT_AMBIENT | Colour sub-chunks | Ambient colour, usually written as 0011 and 0012 |
A020 | MAT_DIFFUSE | Colour sub-chunks | Diffuse colour |
A030 | MAT_SPECULAR | Colour sub-chunks | Specular colour |
A040 | MAT_SHININESS | Percentage sub-chunk | Shininess |
A041 | MAT_SHIN2PCT | Percentage sub-chunk | Shininess strength |
A050 | MAT_TRANSPARENCY | Percentage sub-chunk | Transparency |
A052 | MAT_XPFALL | Percentage sub-chunk | Transparency falloff |
A053 | MAT_REFBLUR | Percentage sub-chunk | Reflection blur |
A084 | MAT_SELF_ILPCT | Percentage sub-chunk | Self-illumination |
A087 | MAT_WIRE_SIZE | float | Wire thickness |
Percentages are usually written with the integer percentage chunk
0030.
Material flags
Flag chunks with no data: present means on.
| ID | Name | Meaning |
|---|---|---|
A080 | MAT_SELF_ILLUM | Self-illumination on |
A081 | MAT_TWO_SIDE | Two-sided: both faces of each triangle are drawn |
A082 | MAT_DECAL | Decal |
A083 | MAT_ADDITIVE | Additive transparency |
A085 | MAT_WIRE | Render as wireframe |
A088 | MAT_FACEMAP | Face mapping: each face takes the whole texture |
A08A | Not named | “In tranc” in 3dsinfo.txt; meaning unknown |
A08C | MAT_PHONGSOFT | Soften (Phong shading softened) |
A08E | MAT_WIREABS | Wire thickness is in units, not pixels |
A240 | MAT_USE_XPFALL | Use the transparency falloff |
A250 | MAT_USE_REFBLUR | Use the reflection blur |
A252 | Not named | “Bump map present (true percent)” in 3dsinfo.txt; data unknown |
A100 – Shading
| Value | Shading |
|---|---|
| 0 | Wireframe |
| 1 | Flat |
| 2 | Gouraud |
| 3 | Phong |
| 4 | Metal |
The data is one word. 3dsinfo.txt calls the chunk “render type”.
Texture maps and masks
A material can have up to eight maps, each with an optional mask. Every map and mask chunk holds the same map sub-chunks.
| Map | ID | Name | Mask ID | Mask name |
|---|---|---|---|---|
| Texture 1 | A200 | MAT_TEXMAP | A33E | MAT_TEXMASK |
| Texture 2 | A33A | MAT_TEX2MAP | A340 | MAT_TEX2MASK |
| Opacity | A210 | MAT_OPACMAP | A342 | MAT_OPACMASK |
| Bump | A230 | MAT_BUMPMAP | A344 | MAT_BUMPMASK |
| Specular | A204 | MAT_SPECMAP | A348 | MAT_SPECMASK |
| Shininess | A33C | MAT_SHINMAP | A346 | MAT_SHINMASK |
| Self-illumination | A33D | MAT_SELFIMAP | A34A | MAT_SELFIMASK |
| Reflection | A220 | MAT_REFLMAP | A34C | MAT_REFLMASK |
Map sub-chunks
| ID | Name | Data | Meaning |
|---|---|---|---|
0030 | INT_PERCENTAGE | word | Strength of the map, 0 to 100 |
A300 | MAT_MAPNAME | strz | Image file name, in MS-DOS 8.3 form in files from the DOS program |
A351 | MAT_MAP_TILING | word | Map options; see below |
A353 | MAT_MAP_TEXBLUR | float | Blur |
A354 | MAT_MAP_USCALE | float | u scale (lib3ds and Assimp; 3dsinfo.txt says v) |
A356 | MAT_MAP_VSCALE | float | v scale (lib3ds and Assimp; 3dsinfo.txt says u) |
A358 | MAT_MAP_UOFFSET | float | u offset |
A35A | MAT_MAP_VOFFSET | float | v offset |
A35C | MAT_MAP_ANG | float | Rotation angle |
A360 | MAT_MAP_COL1 | 3 bytes | First tint colour for luma or alpha tinting |
A362 | MAT_MAP_COL2 | 3 bytes | Second tint colour |
A364 | MAT_MAP_RCOL | 3 bytes | Colour that replaces the image’s red channel in RGB tinting |
A366 | MAT_MAP_GCOL | 3 bytes | Colour that replaces the green channel |
A368 | MAT_MAP_BCOL | 3 bytes | Colour that replaces the blue channel |
The order of the two scale chunks is a known disagreement between the sources; lib3ds and Assimp agree with each other. Tint colours are red, green, blue bytes.
A351 – Map options
| Bit | Value | lib3ds name | Meaning |
|---|---|---|---|
| 0 | 0x0001 | DECALE | Decal |
| 1 | 0x0002 | MIRROR | Mirror the image on each repeat |
| 2 | 0x0004 | None | Unknown |
| 3 | 0x0008 | NEGATE | Invert the image |
| 4 | 0x0010 | NO_TILE | No tiling |
| 5 | 0x0020 | SUMMED_AREA | Summed-area filtering instead of pyramidal |
| 6 | 0x0040 | ALPHA_SOURCE | Use the image’s alpha channel as the map value |
| 7 | 0x0080 | TINT | Luma tint with A360 and A362 |
| 8 | 0x0100 | IGNORE_ALPHA | Ignore the image’s alpha channel |
| 9 | 0x0200 | RGB_TINT | RGB tint with A364 to A368 |
The names are lib3ds’s; the meanings follow from them and from 3D Studio’s map options. Bits 10 to 15 are not known to be used.
A310 – Automatic reflection map
In place of a reflection image, 3D Studio can render a cubic reflection map of the
scene. The A310 chunk (lib3ds MAT_ACUBIC) sets it up:
| Offset | Type | Meaning |
|---|---|---|
| 0 | byte | Unknown |
| 1 | byte | Anti-aliasing: 0 none, 1 low, 2 medium, 3 high |
| 2 | word | Flags: 0x0001 use the automatic map, 0x0004 render the first frame only, 0x0008 flat mirror |
| 4 | dword | Map size |
| 8 | dword | Render every nth frame |
Procedural texture data
Chunks A320 to A338 hold settings for SXP procedural
textures, plug-ins for 3D Studio, one chunk per map or mask:
| ID | Name | For |
|---|---|---|
A320 | MAT_SXP_TEXT_DATA | Texture 1 |
A321 | MAT_SXP_TEXT2_DATA | Texture 2 |
A322 | MAT_SXP_OPAC_DATA | Opacity |
A324 | MAT_SXP_BUMP_DATA | Bump |
A325 | MAT_SXP_SPEC_DATA | Specular |
A326 | MAT_SXP_SHIN_DATA | Shininess |
A328 | MAT_SXP_SELFI_DATA | Self-illumination |
A32A | MAT_SXP_TEXTMASK_DATA | Texture 1 mask |
A32C | MAT_SXP_TEXT2MASK_DATA | Texture 2 mask |
A32E | MAT_SXP_OPACMASK_DATA | Opacity mask |
A330 | MAT_SXP_BUMPMASK_DATA | Bump mask |
A332 | MAT_SXP_SPECMASK_DATA | Specular mask |
A334 | MAT_SXP_SHINMASK_DATA | Shininess mask |
A336 | MAT_SXP_SELFIMASK_DATA | Self-illumination mask |
A338 | MAT_SXP_REFLMASK_DATA | Reflection mask |
Their content belongs to each plug-in and is not documented.