MaterialSpec
the textures, pipeline class, and physical terms one material renders with
Fields
11 members
- Emission: table?
emissive texture, and the tint and intensity it radiates at
- Footsteps: table?
clips a character plays walking on the surfaces, and the gain and pitch spread they play at
- Id:
string id the material is defined and looked up under
- Impacts: table?
clips a contact plays against the surfaces, and the gain and pitch spread they play at
- Model:
string surface model the shader samples with: UV, Triplanar, or Stud
- Name:
string? name the material can be looked up under, in place of the id
- Physics: table?
density, friction, and restitution the solver gives the surfaces
- Pipeline:
string pipeline class the surfaces draw in: Opaque, Cutout, Transparent, Water, or Decal
- Studs: table?
top and bottom stud textures the Stud surface model draws
- Surface: table
base color, normal, and ORM textures, with the tint, tiling, and multipliers applied to them
- Water: table?
absorption, refraction, foam, and wave terms the Water pipeline class solves
Emission
emissive texture, and the tint and intensity it radiates at
| Field | Type |
|---|---|
Intensity | number? |
Texture | string? |
Tint | {r: number, g: number, b: number}? |
Footsteps
clips a character plays walking on the surfaces, and the gain and pitch spread they play at
| Field | Type |
|---|---|
Clips | {string} |
Gain | number? |
PitchSpread | number? |
Impacts
clips a contact plays against the surfaces, and the gain and pitch spread they play at
| Field | Type |
|---|---|
Clips | {string} |
Gain | number? |
PitchSpread | number? |
Physics
density, friction, and restitution the solver gives the surfaces
| Field | Type |
|---|---|
Density | number? |
Friction | number? |
Restitution | number? |
Studs
top and bottom stud textures the Stud surface model draws
| Field | Type |
|---|---|
ColorBottom | string? |
ColorTop | string? |
NormalBottom | string? |
NormalTop | string? |
StudsPerTile | number? |
Surface
base color, normal, and ORM textures, with the tint, tiling, and multipliers applied to them
| Field | Type |
|---|---|
AlphaCutoff | number? |
BaseColor | string? |
MetallicMult | number? |
Neon | boolean? |
Normal | string? |
NormalStrength | number? |
Orm | string? |
RoughnessMult | number? |
TileSize | number? |
Tint | {r: number, g: number, b: number, a: number}? |
TintVertex | boolean? |
Water
absorption, refraction, foam, and wave terms the Water pipeline class solves
| Field | Type |
|---|---|
Absorption | {r: number, g: number, b: number}? |
DepthScale | number? |
FlowMap | string? |
FlowScale | number? |
FlowSpeed | number? |
Foam | string? |
FoamDepth | number? |
FoamScale | number? |
Refraction | number? |
WaveAmplitude | number? |
WaveScale | number? |
WaveSpeed | number? |
Defining a Material
Lifecycle: Server
Id, Pipeline, and Model define the material on their own; each grouped table below them is optional.
local id = game.Materials.DefineMaterial({ Id = "dungeon_stone", Pipeline = "Opaque", Model = "Triplanar", Surface = { TileSize = 4, RoughnessMult = 0.8 }, Physics = { Friction = 0.7, Restitution = 0.1 }})print("Defined material:", id)