CONTENT CONTRACT · VERSION 1
material
A native material selecting one fixed engine shader family.
Signature
{ color_rgb: {ColorChannel}, family: (MaterialFamily)?, hardness: PositiveCount, id: ContentId, kind: "material", mining: (TerrainMining)?, shader: MaterialShader, solid: boolean, surface: (TerrainSurface)?, voxel_material: (Name)? }Fields
| Name | Type | Meaning |
|---|---|---|
color_rgb | {ColorChannel} | Red, green and blue channels in that order. Items: 3…3 |
family | MaterialFamily | How the material takes damage in a prefab; required for and only allowed with the voxel shader. |
hardness | PositiveCount | Positive resistance to harvesting or destruction. Range: 1…2147483647; Unit: count |
id | ContentId | Package-qualified identity; unique within its declaring namespace. Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$ |
kind | "material" | Discriminant |
mining | TerrainMining | Optional terrain resource binding, yield, durability and contact behavior. |
shader | MaterialShader | Rendering family used for this material. |
solid | boolean | Whether this material contributes solid collision geometry. |
surface | TerrainSurface | Engine terrain surface; required for and only allowed with the terrain shader. |
voxel_material | Name | Voxel material of the map's world library; required for and only allowed with the voxel shader. Length: 1…96; Pattern: ^[a-z][a-z0-9_]{0,95}$ |
Validated example
{
"color_rgb": [
222,
193,
134
],
"hardness": 1,
"id": "core:beach_sand",
"kind": "material",
"mining": {
"hits": 1,
"impact": "loose",
"item": "core:sand",
"regrows": false,
"resource_code": 0,
"target_material": "sand"
},
"shader": "terrain",
"solid": true,
"surface": "sand"
}