MaterialSpec¶
Type
MaterialSpec describes a material for Materials.DefineMaterial and Materials.GetMaterial.
Name¶
Name is 1 to 31 bytes, defaulting to the next unused "Material<n>".
Pipeline¶
Pipeline is "Opaque", "Cutout", "Transparent", "Water", or "Decal" (MaterialPipeline). "Water" and "Decal" require Model "UV"; when Shader is set, Pipeline defaults to "Opaque" and allows "Opaque", "Cutout", or "Transparent".
Anchored "Water" parts are swimmable fluid volumes; unanchored "Water" parts stay solid.
Model¶
Model is "UV", "Triplanar", or "Stud" (SurfaceModel), defaulting to "UV" when Shader is set.
Shader¶
Shader is a shader file name in shaders/ without .slang, or nil; see writing a material shader.
Blend¶
Blend is "Alpha" or "Additive" (MaterialBlend, default "Alpha"). Requires Shader; see transparent materials.
Faces¶
Faces is "Front", "Back", or "Both" (MaterialFaces, default "Front"). Requires Shader; see faces.
Params¶
Params maps up to 16 shader field names to numbers, vectors, booleans, or texture asset IDs, or is nil. Update values at runtime with Materials.SetParam.
Surface¶
Surface is the MaterialSurface table, optional when Shader is set.
Emission¶
Emission is the MaterialEmission table, or nil.
Studs¶
Studs is the MaterialStuds table when Model is "Stud", or nil.
Water¶
Water is the MaterialWater table when Pipeline is "Water", or nil.
Physics¶
Physics is the MaterialPhysics table, or nil.
Footsteps¶
Footsteps is the MaterialAudio table for footsteps, or nil.
Impacts¶
Impacts is the MaterialAudio table for impacts, or nil.