Glow Maps

Glow maps allow you to switch between multiple materials based on a function.

They are mostly used with lights to switch to an emissive texture when the lights are on. However they can also be used for things like warning lamps on the dashboard, and other applications where switching materials based on a function is required.

They offer the possibility for 3 different materials, refered to as “off”, “on” and “on_intense”.

The switch between modes works by adding together a few inputs using multipliers. If the total value is 0, the glowMap will be “off”, between 0 and 0.5 will be “on”, and above will be “on_intense”. The simple function result can be greater than 1.

For example here, when the high or low beams are on, the function equals 0.49, meaning the glowmap state will be “on”, while if both the high/low beams are on, and the brake pedal is fully depressed, the function will equal 0.98, meaning the glowmap state will be “on_intense”.

"glowMap":{
"taillight":{"simpleFunction":{"brake":0.49,"lowhighbeam":0.49},    "off":"lights",   "on":"lights_on", "on_intense":"lights_on_intense"},
}

It should be noted in that specific case that while lowhighbeam will always be 0 or 1, brake is equal to the braking input, meaning the value can be anywhere between 0 and 1. Keep this in mind when definining the weight of the various functions to make sure they work as expected.

Required arguments

string
type
The name of the material assigned to the mesh.
string/dictionary
type
Electrics used to define the glowmap along with optional multipliers.

See the electrics page for a list of some of the available electrics.

If only one value with no modifier is specified, the modifier value will be set to 1.

"simpleFunction":"brake"

You can specify multiple arguments as a dictionary with modifiers.

"simpleFunction":{"brake":0.49,"lowhighbeam":0.49}

If the total is 0, the “off” state will be used. Between 0 and 0.5, the “on” material will be used, and above 0.5, the “on_intense” material will be used. The total value can be greater than 1.

string
type
The material to use when the glowMap state is off
The material to use when the the functions add up to 0
string
type
The material to use when the glowMap state is on
The material to use when the the functions add up between 0 and 0.5
string
type
The material to use when the glowMap state is on_intense

The material to use when the the functions add up over 0.5.

If no material is specified for “on_intense”, the “on” material will be used.

Simple Example

"glowMap":{
        "beaconlight":                   {"simpleFunction":"lightbar", "off":"beaconlight", "on":"beaconlight_on"},
        "beaconlight_orange_glass":                   {"simpleFunction":"lightbar", "off":"beaconlight_orange_glass", "on":"beaconlight_orange_glass_on"},
},

Advanced Example

"glowMap":{
            "signal_L":     {"simpleFunction":{"parking":0.49,"signal_L":0.49,"lowhighbeam":0.49}, "off":"lights", "on":"lights_on", "on_intense":"lights_on_intense"},
            "signal_R":     {"simpleFunction":{"parking":0.49,"signal_R":0.49,"lowhighbeam":0.49}, "off":"lights", "on":"lights_on", "on_intense":"lights_on_intense"},
            "taillight":    {"simpleFunction":{"brake":0.49,"lowhighbeam":0.49},                   "off":"lights", "on":"lights_on", "on_intense":"lights_on_intense"},
            "chmsl":        {"simpleFunction":{"brake":100},                                       "off":"lights", "on":"lights_on", "on_intense":"lights_on_intense"},
            "foglight":     {"simpleFunction":{"fog":1},                                   "off":"lights", "on":"lights_on_intense", "on_intense":"lights_on_intense"},
            "headlight":    {"simpleFunction":{"lowbeam":0.49,"highbeam":0.49},                    "off":"lights", "on":"lights_on", "on_intense":"lights_on_intense"},
            "parkinglight": {"simpleFunction":{"parking":0.49,"highbeam":1},                       "off":"lights", "on":"lights_on", "on_intense":"lights_on_intense"},
            "reverselight": {"simpleFunction":{"reverse":0.49},                                    "off":"lights", "on":"lights_on", "on_intense":"lights_on_intense"},
            "gauges":       {"simpleFunction":{"lowhighbeam":0.6},                                 "off":"gauges", "on":"gauges_on"},
            //gauge lights
            "signal_L":              {"simpleFunction":"signal_L", "off":"invis", "on":"decals_gauges"},
            "signal_R":              {"simpleFunction":"signal_R", "off":"invis", "on":"decals_gauges"},
            "checkengine":           {"simpleFunction":"checkengine", "off":"invis", "on":"decals_gauges"},
            "hazard":                {"simpleFunction":"hazard", "off":"invis", "on":"decals_gauges"},
            "battery":               {"simpleFunction":"battery", "off":"invis", "on":"decals_gauges"},
            "highbeam":              {"simpleFunction":"highbeam", "off":"invis", "on":"decals_gauges"},
            "parkingbrake":          {"simpleFunction":"parkingbrake", "off":"invis", "on":"decals_gauges"},
            "lowfuel":               {"simpleFunction":"lowfuel", "off":"invis", "on":"decals_gauges"},
            "lowpressure":           {"simpleFunction":"lowpressure", "off":"invis", "on":"invis"},
            "abs":                   {"simpleFunction":"abs", "off":"invis", "on":"decals_gauges"},

            "light_generic":{"simpleFunction":{"highbeam":1}, "off":"light_generic", "on":"light_generic_on", "on_intense":"light_generic_on_intense"}
}
Last modified: June 18, 2024

Any further questions?

Join our discord
Our documentation is currently incomplete and undergoing active development. If you have any questions or feedback, please visit this forum thread.