BeamNG uses a PBR (Physically-Based Rendering) materials system. For the purposes of this page, it means that the car paint has a few basic properties that define the way it looks and reacts to lighting, including:
You can visit this page for an overview of the PBR material properties.
The material definition, present inside the materials.json
file, defines how each of these properties is set:
One of the color palettes visualized inside the in-game paint selector. The ‘Chrominess’ property is a legacy feature and is not functional with physically based rendering materials.
Inside the materials.json
file, the instanceDiffuse
property decides whether the material is colorable (true) or not (false). If it is set to true, a color palette map
will determine which parts of the UV map are affected by which one of the three color palettes. Full RGBA color values are used:
Example of a color palette map for a two-tone paint setup.
Mixing different colors allows for gradient effects formed by the paint colors chosen by the user on different palettes.
Example of a color palette map with a gradient effect.
The color set by the user on the palette is then multiplied by the material properties. For example, the value on the metallic slider will be multiplied by the color value on the metallicMap
and the number value in metallicFactor
. In practice, for vehicle paints the multiplier colors are set to full white, and the values to 1, in order to prevent unwanted color mixing.
Usually, the way paint materials are set up on a vehicle is that a full red texture is used for the color palette map, overlaid by an opacity map
. The white parts of the opacity map dictate which parts of the vehicle are covered by the paint, making them colorable with the first color palette. This setup makes it easy to introduce skins on the second UV map. Check this page for more information.
There are some additional properties inside the materials.json
file that affect the way the color palette map works:
colorPaletteMapUseUV
: When set to 1, which is usually the case for paint materials, the second UV map will be used. This makes it easier to lay out skins.paletteBaseColor
: Defaults to true, if set to false then the color setting of the color palette will NOT work, and the material will instead use the default color values set for the material in the base color map and/or the base color factor, rather than multiplying it with the one set by the palette. This means that the color palette will only affect the metallic, roughness, clear coat, and clear coat roughness values, rather than the color of the paint.paletteClearCoat
, paletteClearCoatRoughness
, paletteMetallic
, paletteRoughness
.Was this article helpful?