Material Descriptors
A material descriptor is a JSON file in the materials/ directory.
It binds a shader and PBR property values together, and is referenced by
glitter_primitive model descriptors via materials:// URIs.
The engine ships with 100+ physically-based material presets (metals, dielectrics, organics, liquids, skin tones) sourced from real-world measured data, plus a set of prototype materials for scene layout.
Format overview
Glitter uses a v2 flat format where all scalar factors live at the top level
and textures live in a "textures" block. This mirrors the glTF 2.0 material
model extended with all supported KHR extensions plus engine-specific features
like subsurface scattering.
{
"description": "Human-readable label",
"shader": "shaders://pbr.json",
"baseColorFactor": [1.0, 1.0, 1.0, 1.0],
"metallicFactor": 0.0,
"roughnessFactor": 0.9,
"emissiveFactor": [0.0, 0.0, 0.0],
"alphaMode": "OPAQUE",
"alphaCutoff": 0.5,
"textures": {
"baseColor": "textures://wall_albedo.ktx2",
"metalRough": "textures://wall_mr.ktx2",
"normal": "textures://wall_normal.ktx2",
"occlusion": "textures://wall_ao.ktx2",
"emissive": "textures://wall_emissive.ktx2"
}
}
Core PBR fields
| Field | Default | Description |
|---|---|---|
shader | — | shaders:// URI to the shader descriptor (required) |
description | — | Human-readable label |
baseColorFactor | [1,1,1,1] | RGBA tint — multiplied with baseColor texture when present |
metallicFactor | 1.0 | 0 = dielectric, 1 = fully metallic |
roughnessFactor | 1.0 | 0 = mirror, 1 = fully rough |
emissiveFactor | [0,0,0] | Emissive RGB multiplier |
alphaMode | "OPAQUE" | "OPAQUE", "MASK" (hard cutout), or "BLEND" (translucent) |
alphaCutoff | 0.5 | Alpha threshold for MASK mode |
Texture block
All textures are specified inside a "textures" object using textures:// URIs:
"textures": {
"baseColor": "textures://albedo.ktx2",
"metalRough": "textures://mr.ktx2",
"normal": "textures://normal.ktx2",
"occlusion": "textures://ao.ktx2",
"emissive": "textures://emissive.ktx2",
"specular": "textures://specular.ktx2",
"specularColor": "textures://specular_color.ktx2",
"clearcoat": "textures://clearcoat.ktx2",
"clearcoatRoughness": "textures://clearcoat_rough.ktx2",
"clearcoatNormal": "textures://clearcoat_normal.ktx2",
"transmission": "textures://transmission.ktx2"
}
All texture fields are optional. When a texture is absent, the corresponding scalar factor is used as a constant value.
Extended PBR properties
These mirror the standard glTF 2.0 KHR material extensions supported by the engine.
KHR_materials_emissive_strength
"emissiveStrength": 5.0
Multiplier on top of emissiveFactor for HDR emissive surfaces (default 1.0).
KHR_materials_ior
"ior": 1.52
Index of refraction (default 1.5). Affects Fresnel reflectance at normal incidence. Common values:
| Material | IOR |
|---|---|
| Air | 1.0 |
| Water | 1.333 |
| Glass | 1.52 |
| Diamond | 2.42 |
| Skin | 1.4 |
KHR_materials_specular
"specularFactor": 1.0,
"specularColorFactor": [1.0, 1.0, 1.0]
KHR_materials_clearcoat
"clearcoatFactor": 0.5,
"clearcoatRoughnessFactor": 0.1
Adds a second specular lobe for clear-coated surfaces (car paint, varnish).
KHR_materials_transmission
"transmissionFactor": 1.0
Makes the surface transmit light (glass, water). Set alphaMode to "BLEND" for correct rendering.
KHR_materials_volume
"thicknessFactor": 0.5,
"attenuationDistance": 2.0,
"attenuationColor": [0.8, 1.0, 0.8]
Controls light absorption through a volume. Used with transmission for coloured glass, liquids, etc.
KHR_materials_dispersion
"dispersion": 64.0
Chromatic dispersion — splits transmitted light into a rainbow. Higher values = stronger effect. Used for glass, diamonds, water.
Subsurface scattering
Engine-specific extension for skin, wax, marble, and other translucent materials:
"scatteringDistance": 0.253,
"scatteringColor": [0.482, 0.169, 0.109],
"scatteringAnisotropy": 0.0
| Field | Default | Description |
|---|---|---|
scatteringDistance | 0.0 | Mean free path — how far light travels inside the material |
scatteringColor | [1,1,1] | Colour tint of the scattered light |
scatteringAnisotropy | 0.0 | Directionality: 0 = isotropic, positive = forward scatter, negative = back scatter |
Material inheritance
A material can inherit from a base material using the "base" field. The child overrides any scalar values from the parent, up to 4 levels deep. Textures are not inherited — only the leaf material's textures are used.
{
"base": "materials://physicallybased/gold.json",
"roughnessFactor": 0.05
}
This inherits gold's baseColorFactor and metallicFactor but overrides roughness.
Examples
Pure metal (gold)
{
"description": "Physically Based — Gold",
"shader": "shaders://pbr.json",
"baseColorFactor": [1.059, 0.773, 0.307, 1.0],
"metallicFactor": 1.0,
"roughnessFactor": 0.0
}
Transparent dielectric (glass)
{
"description": "Physically Based — Glass",
"shader": "shaders://pbr.json",
"baseColorFactor": [1, 1, 1, 1.0],
"metallicFactor": 0.0,
"roughnessFactor": 0.0,
"ior": 1.52,
"transmissionFactor": 1.0,
"dispersion": 64.0,
"alphaMode": "BLEND"
}
Subsurface scattering (skin)
{
"description": "Physically Based — Skin III",
"shader": "shaders://pbr.json",
"baseColorFactor": [0.623, 0.433, 0.343, 1.0],
"metallicFactor": 0.0,
"roughnessFactor": 0.5,
"ior": 1.4,
"scatteringDistance": 0.253,
"scatteringColor": [0.482, 0.169, 0.109]
}
Textured prototype
{
"description": "Green shiny — polished metallic surface",
"shader": "shaders://pbr.json",
"baseColorFactor": [1.0, 1.0, 1.0, 1.0],
"metallicFactor": 0.85,
"roughnessFactor": 0.1,
"textures": {
"baseColor": "textures://prototypes/green/texture_09.ktx2"
}
}
Physically-based material database
The engine ships with 100+ measured material presets in engine_defaults/materials/physicallybased/. These are ready to use via materials://physicallybased/ URIs.
All physically-based presets are sourced from the Physically Based open database by Anton Palmqvist.
Metals
Aluminum, Beryllium, Brass, Cesium, Chromium, Cobalt, Copper, Germanium, Gold, Iridium, Iron, Lead, Lithium, Magnesium, Manganese, Mercury, Molybdenum, Nickel, Palladium, Platinum, Potassium, Rubidium, Silicon, Silver, Sodium, Stainless steel, Titanium, Tungsten, Vanadium, Zinc, plus coloured variants (aluminum anodized red, titanium anodized).
Dielectrics & crystals
Amber, Diamond, Glass, Pearl, Porcelain, Quartz, Sapphire, Terracotta, plus plastics (acrylic, PC, PET, PP, PUR, PVC).
Organics & foods
Banana, Blood, Bone, Carrot, Charcoal, Chocolate, Coffee, Egg shell (brown/white), Grass, Honey (liquid/crystallized), Ketchup, Lemon, Milk, Orange, Toothpaste.
Construction & surfaces
Asphalt, Blackboard, Brick, Cardboard, Concrete, Marble, Office paper, Polystyrene foam, Salt, Sand, Snow, Toilet paper, Tire, Whiteboard.
Liquids & transparent
Cooking oil, Gasoline, Ice, Petroleum, Soap bubble, Water.
Human
Skin I–VI (Fitzpatrick scale with per-type scattering parameters), Eye (cornea, lens, sclera).
Reference targets
Gray card, MIT Black, Musou Black, Spectralon, Toner black.
Special surfaces
Car paint (metallic flake), Aluminum anodized red, Titanium anodized.
Prototype material catalogue
Ready-made materials for scene layout and testing. All live under materials://prototypes/.
Orange
| File | Base texture | Notes |
|---|---|---|
orange_grid.json | Orange/texture_02.png | General structural surface |
orange_grid_marker.json | Orange/texture_07.png | Grid with marker squares |
orange_metal.json | Orange/texture_02.png | Metallic finish (metallicFactor: 1.0) |
orange_panel.json | Orange/texture_06.png | Flat panel / wall tile |
orange_caution.json | Orange/texture_11.png | Hazard stripe |
orange_stair.json | Orange/texture_11.png | Staircase tread surface |
orange_stair_side.json | Orange/texture_02.png | Staircase riser / side face |
orange_marker.json | Orange/texture_07.png | Low-visibility marker |
Green
| File | Base texture | Notes |
|---|---|---|
green_grid.json | Green/texture_02.png | General structural surface |
green_panel.json | Green/texture_06.png | Flat panel / wall tile |
green_marker.json | Green/texture_07.png | Marker squares |
green_shiny.json | Green/texture_02.png | Shiny finish (roughnessFactor: 0.1) |
Purple
| File | Base texture | Notes |
|---|---|---|
purple_grid.json | Purple/texture_02.png | General structural surface |
purple_wall.json | Purple/texture_01.png | Wall tile with label |
purple_marker.json | Purple/texture_07.png | Marker squares |
purple_shiny.json | Purple/texture_02.png | Shiny finish |
Red
| File | Base texture | Notes |
|---|---|---|
red_grid.json | Red/texture_02.png | General structural surface |
red_brick.json | Red/texture_01.png | Brick-like wall tile |
red_metal.json | Red/texture_02.png | Metallic finish |
red_marker.json | Red/texture_07.png | Marker squares |
Light / Dark
| File | Base texture | Notes |
|---|---|---|
light_floor.json | Light/texture_01.png | Pale stone / floor tile |
light_trim.json | Light/texture_02.png | Trim / edge marker |
dark_ground.json | Dark/texture_01.png | Dark ground / base surface |
dark_wall.json | Dark/texture_02.png | Dark wall surface |
Relationship to model descriptors
glitter_primitive model descriptors reference materials by URI:
"glitter_primitive": {
"materials": [
"materials://prototypes/orange_grid.json",
"materials://prototypes/orange_metal.json"
],
"elements": [ ... ]
}
See Model Descriptors for the full primitive format including per-face material assignment.
For gltf models, materials are embedded in the glTF asset — no separate material
descriptor is used.