Material
Material is the imperative material API for a single live material, reached via the material property on a hydrated Component — for example RendererGroupComponent.material (body/trim paint) or DecalComponent.material (a decal projector’s material).
Every car gets its own copy of its materials as it loads, so what you reach here belongs to one car: a write lands on that car and leaves every other car of the type as it was. To change them all, write to each car’s material, or set a style they all resolve.
Configuration
Section titled “Configuration”configuration MaterialConfiguration Named material mode to apply Applies a named MaterialConfiguration to this material, establishing its mode (shader, keywords, and property defaults) declaratively instead of toggling shader keywords by hand. Idempotent — call it before setting content (textures/colors); a redundant call with the same configuration is a no-op and won’t clobber properties the script has already set.
| Value | Description |
|---|---|
carStandard | Car body, paint map off — the default, unpainted look. Disables the body’s paint-map keyword on whichever car graph (metallic or specular) the body already uses; does not swap the material. |
carPaintMap | Car body, paint map on. Enables the paint-map keyword on whichever car graph the body already uses, preserving the car’s own base/normal/etc. textures. |
decalPaintMap | Decal projector configured for an image paint map (per-zone SDFs + a silhouette alpha). Establishes the paint-map decal shader/material on the projector’s material. |
component.material.configure(MaterialConfiguration.carPaintMap)Colors, Floats, and Vectors
Section titled “Colors, Floats, and Vectors”name string Material property name hex string #RGB, #RGBA, #RRGGBB, or #RRGGBBAA Sets a Color material property from a hex string. Faithful to the bytes given — any “metallic” convention (like the packed params setColorParamsUsingStyle writes) layers on top of this primitive, not inside it. Throws if hex doesn’t parse.
colorName string Material property to receive the parsed color paramsName string Material property to receive the packed params vector (x = metallic, y = smoothness) styleString string A bare hex color (matte), or metallic(#hex, m[, s]) Sets a color property and its paired params property from one paint-material style string in one call, instead of parsing it in script. Accepts a bare hex color (matte finish) or the function form metallic(#hex, m[, s]) (m = metallic 0..1, optional s = smoothness 0..1). Throws if styleString doesn’t parse.
component.material.setColorParamsUsingStyle("_Color", "_Params", "metallic(#8899AA, 0.9, 0.6)")name string Material property name value float Sets a float material property.
name string Material property name x float y float z float = 0 w float = 0 Sets a Vector4 material property. x and y are required; z and w default to 0, handy for packed params with reserved channels. Faithful float storage, not a 0..1 color.
Keywords
Section titled “Keywords”keyword string Disables a shader keyword on the material.
keyword string Enables a shader keyword on the material (e.g. a feature toggle like a paint-map mode).
Textures
Section titled “Textures”name string Material property name assetRef string Asset pack reference, e.g. "./mytexture.png" or "rr/some-pack/texture.png" Loads a texture from an asset pack and sets it on the material once resident.
The reference is resolved synchronously and throws if it does not resolve — a typo, or its pack is not loaded — so authoring mistakes fail fast and visibly to the script. The actual data load is async and fire-and-forget: the texture appears a frame or more after the call, and a resolved-but-unloadable asset (e.g. a bad bundle) only logs an error rather than throwing. Loading is ref-counted and deduplicated by the asset store, so many materials sharing one reference load it once.
The loaded texture is owned by the component’s GameObject and releases automatically when the component dehydrates. Relative ("./") references resolve against the definition that owns this material; cross-pack references must be absolute ("rr/...").
© 2026 Giraffe Lab LLC. All rights reserved.