Skip to content

Commit f3b00ac

Browse files
author
Anaminus
committed
Add spec for Terrain.MaterialColors property.
Closes #6.
1 parent 2b6831e commit f3b00ac

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

properties/MaterialColors.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Terrain MaterialColors format
2+
This document describes the binary format of the
3+
[Terrain.MaterialColors][MaterialColors] property.
4+
5+
The format of the MaterialColors property is a constant-sized array of colors.
6+
Each group of 3 bytes represents a Color3 value corresponding to a particular
7+
[Material][Material] enum item. Not all materials are represented. The 3 bytes
8+
in a group correspond to the red, green, and blue components of the Color3,
9+
respectively. The first two groups in the array appear to always be zeroed.
10+
11+
The following table lists the nth byte in the sequence, in decimal format. Each
12+
row corresponds to a particular material, and the columns indicate the red
13+
(`RR`), green (`GG`) or blue (`BB`) component of the material's color:
14+
15+
```text
16+
RR GG BB
17+
18+
00 01 02 (reserved)
19+
03 04 05 (reserved)
20+
06 07 08 Grass
21+
09 10 11 Slate
22+
12 13 14 Concrete
23+
15 16 17 Brick
24+
18 19 20 Sand
25+
21 22 23 WoodPlanks
26+
24 25 26 Rock
27+
27 28 29 Glacier
28+
30 31 32 Snow
29+
33 34 35 Sandstone
30+
36 37 38 Mud
31+
39 40 41 Basalt
32+
42 43 44 Ground
33+
45 46 47 CrackedLava
34+
48 49 50 Asphalt
35+
51 52 53 Cobblestone
36+
54 55 56 Ice
37+
57 58 59 LeafyGrass
38+
60 61 62 Salt
39+
63 64 65 Limestone
40+
66 67 68 Pavement
41+
```
42+
43+
For example, the 34th byte indicates the green component of the Sandstone
44+
material's color.
45+
46+
[MaterialColors]: https://developer.roblox.com/en-us/api-reference/property/Terrain/MaterialColors
47+
[Material]: https://developer.roblox.com/en-us/api-reference/enum/Material

0 commit comments

Comments
 (0)