Vehicle Lights - user-grinch/ModelExtras GitHub Wiki
To activate lights in-game using the Model Extras plugin, you need to assign a specific material with the correct color to the mesh of the vehicle model. The plugin recognizes the material's purpose (e.g. brake, turn, tail) based on its color and automatically adjusts its brightness to simulate the light being turned on.
Each light material has two states:
Off โ the default texture is displayed.
On โ the same texture is shown, but with increased brightness applied automatically.
๐ก Tip: You can also assign a custom emissive texture for the "on" state. This is explained in the section below.
To simulate the light glow, place a node/dummy on the area of the mesh where a corresponding light material is applied. The name of the dummy determines the type of light. Based on this name, the plugin will know to enable a corona (glow effect) at that position.
The visual properties of each corona โ such as its color, direction, size, and intensity โ are defined in the vehicleโs .jsonc config file (e.g. burrito.jsonc).
- โฌ ๏ธ Z: Left turn signal
- โน Left Shift: Turns off indicators
- ๐ X: Activates hazard lights (both turn signals)
- โก๏ธ C: Right turn signal
- โ๏ธ J: Toggles fog lights
- ๐ก G: Toggles long headlights (high beams)
- ๐ B: Toggles Spotlights
- โถ RMB: Rotates Spotlights
Indicator lights dynamically activate when turning or changing lanes, ensuring that vehicles visually communicate their intentions.
- ๐ข Supports both player & NPC vehicles
- ๐๏ธ AutoIndicatorsOnSteer (INI Setting): When enabled (
AutoIndicatorsOnSteer = 1inModelExtras.ini), turning the steering wheel or holding steering keys (A/D/ Arrow keys) automatically engages the corresponding turn signal, and cancels it once the steering wheel straightens out.
On stock vehicles that lack custom indicator dummies/materials, enabling StandardLights_GlobalIndicatorLights = 1 under [LIGHTS] in ModelExtras.ini will automatically flash the vehicle's rear taillights as turn signals, complete with synchronized real-time dynamic point lights!
- Long Lights (High Beams): Pressing G toggles high-beam headlights, amplifying headlight material intensity and extending dynamic point light range. High-beam toggle requires headlights to be active.
-
Volumetric Beams: Controlled via
HeadLightBeams = 1under[LIGHTS]inModelExtras.inito render classic volumetric light beam cones extending from the headlights.
ModelExtras renders dynamic, real-time ground point lights across all vehicle lighting elements:
- Headlights & High-Beams
- Taillights & Brake Lights
- Turn Indicators & Hazard Lights
- Fog Lights & Reverse Lights
- Spotlights & Siren Strobes
- Ground shadows feature realistic 3D vehicle leaning orientation, tilting accurately as the vehicle turns, pitches, or navigates uneven terrain.
Fog lights improve visibility in foggy or low-light conditions by illuminating the road directly ahead.
-
Manual Toggle: Can be toggled manually by the player using the
FogLightKey(default: J). - Weather-Reactive: When foggy weather occurs in San Andreas, fog lights automatically illuminate.
-
FoglightTiedToHeadlight (INI Setting): When enabled (
FoglightTiedToHeadlight = 1inModelExtras.ini), fog lights will only turn on if main headlights are active. Set to0for completely independent toggle. -
Note: FogLights don't cast shadows by default. Specify
sizein JSONC or_prmto enable ground shadows.
Reverse lights activate dynamically when the vehicle shifts into reverse gear, illuminating the ground and area behind the vehicle with white light and signaling reversing maneuvers.
- Brake Lights: Engage dynamically when the vehicle slows down, stops, or applies brakes. This is recommended if the vehicle has a separate mesh for brake lights. If the vehicle uses the same mesh for both taillights and brake lights, the game runs as vanilla.
-
PlayerIdleBrakeLights (INI Setting): When enabled (
PlayerIdleBrakeLights = 1inModelExtras.ini), the player's brake lights automatically remain illuminated while the vehicle is stopped and idling, releasing smoothly upon throttle input.
For vehicles equipped with pop-up retractable headlights (e.g. ZR-350, custom mod models), ModelExtras synchronizes light coronas, dynamic point lights, and volumetric beams with the pop-up cover animation, activating illumination only after the covers finish fully opening.
This is the modern rear lighting system commonly found on American vehicles from the 1990s to the present day. In this setup, the brake and turn signal functions share the same light unit, while the tail light is a completely separate element โ often a thin strip or dedicated section of the rear light cluster (for those just use ๐ light_night). This system is ideal for modern vehicles intended for use under North American traffic laws.
๐ How it works:
- ๐ด Stop Function: The main rear light turns on at full brightness when the brake pedal is pressed. (material + corona)
- ๐ด Turn Function: The same light flashes when turn signals are active. If braking and turning at the same time, one side flashes while the other stays steady. (material + corona)
- ๐ด Stop + Turn (Combined): The turning side flashes (turn signal has priority), the opposite side stays on as a brake light.
๐กTip: Stick to red materials and coronas for this setup โ American cars donโt use amber indicators like most other countries do.
Stop-Tail-Turn Lights are multifunctional rear lights that combine brake lights, tail lights, and turn signals into a single unit. This system was widely used in American vehicles from the 1950s to the 1980s, especially in classic sedans, muscle cars, and pickups โ making it ideal for retro-inspired cars in GTA San Andreas.
๐ How it works:
- ๐ด Stop Function: The light activates at full brightness when the brake pedal is pressed. (material + corona).
- ๐ก Tail Function: The light stays on when the lights are turned on, providing rear visibility at night. (material + corona).
- ๐ Turn Function: The same light flashes on and off when the turn signals are active. (material + corona, At night, this light is never dim while braking or turning, only corona blinks).
๐กTip: Stick to red materials and coronas for this setup โ American cars donโt use amber indicators like most other countries do.
Side lights work as marker lights on vehicle bodies, often used on trucks and trailers. They turn on automatically at night, just like the "light_night" dummy, casting light shadows to the left and right sides respectively.
Spot lights are high-intensity directional lights mounted on a vehicle to provide illumination in a specific direction. They are typically used for off-road driving, law enforcement, emergency response, and utility work. Unlike standard headlights, which are designed to illuminate the road ahead, spotlights can be aimed and rotated using the right mouse button.
Strobe lights are high-intensity flashing lights often used in emergency vehicles, law enforcement, or show vehicles. They create a distinctive flashing effect that grabs attention and enhances visibility in critical situations.
๐ How it works:
- โก Strobes will automatically flash on and off at a rapid rate.
- ๐ Each strobe is independent, allowing varied flashing patterns via configuration.
- ๐๏ธ Their flashing behavior can be adjusted via JSONC config (
strobedelay).
๐กTip: Ideal for emergency vehicles like police cars, ambulances, fire trucks, or even futuristic custom vehicles.
They turn on according to the times indicated by their respective dummies, working automatically:
- ๐ธ light_day: will remain on only during the day and will turn off at night.
- ๐น light_night: will remain on during the night and will be off during the day.
- ๐ธ light_allday: will always be on, regardless of the time.
Note: Night materials are off during daytime & day materials are off during night time.
-
โช headlights / headlights2 โ Left Headlight
Material Color: 255 175 0 -
โช headlights / headlights2 โ Right Headlight
Material Color: 0 255 200 - Note: You only need to add one headlights or headlights2 dummy to the right side of the vehicle. The game will automatically duplicate it to the left side.
- Noteยฒ: Pressing G (LongLightKey) toggles high beam mode, boosting headlight material brightness and casting extended pointlights.
-
๐ด taillights / taillights2 โ Left Taillight
Material Color: 185 255 0 -
๐ด taillights / taillights2 โ Right Taillight
Material Color: 255 60 0 - Note: You only need to add one taillights or taillights2 dummy to the right side of the vehicle. The game will automatically duplicate it to the left side.
-
๐ธ indicator_lf / turnl_lf โ Left Front Indicator
Material Color: 183 255 0 -
๐น indicator_rf / turnl_rf โ Right Front Indicator
Material Color: 255 58 0 -
๐ธ indicator_lm / turnl_lm โ Left Middle Indicator
Material Color: 182 255 0 -
๐น indicator_rm / turnl_rm โ Right Middle Indicator
Material Color: 255 57 0 -
๐ธ indicator_lr / turnl_lr โ Left Rear Indicator
Material Color: 181 255 0 -
๐น indicator_rr / turnl_rr โ Right Rear Indicator
Material Color: 255 56 0
-
โช foglight_l / fogl_l โ Left Fog Light
Material Color: 255 174 0 -
โช foglight_r / fogl_r โ Right Fog Light
Material Color: 0 255 199
-
โฌ
๏ธ
revl_l/reversingl_l/reversinglight_lโ Left Reverse LightMaterial Color: 255 173 0 -
โก๏ธ
revl_r/reversingl_r/reversinglight_rโ Right Reverse LightMaterial Color: 0 255 198
-
๐ด breaklight_l / breakl_l โ Left Brake Light
Material Color: 184 255 0 -
๐ด breaklight_r / breakl_r โ Right Brake Light
Material Color: 255 59 0
-
โฌ
๏ธ sidelight_l โ Left Side Light
Material Color: 255 200 1 -
โก๏ธ sidelight_r โ Right Side Light
Material Color: 255 200 2
-
โฌ
๏ธ sttlight_l โ Left STT Light
Material Color: 255 200 3 -
โก๏ธ sttlight_r โ Right STT Light
Material Color: 255 200 4
-
๐ด nabrakelight_l โ Left Brake Light
Material Color: 255 200 5 -
๐ด nabrakelight_r โ Right Brake Light
Material Color: 255 200 6
-
๐ฆ spotlight_light
XโXcan be any number, allowing for multiple spotlights.Material Color: 255 200 7 - โญฏ spotlight_dummy โ Object rotated from its pivot along with the spotlight beam.
-
โก strobe_light1 โ
Material Color: 255 199 1 -
โก strobe_light2 โ
Material Color: 255 199 2 -
โก strobe_light3 โ
Material Color: 255 199 3 -
โก strobe_light255 โ
Material Color: 255 199 255
Each strobe dummy must be paired with a specific material color for the plugin to recognize and animate them correctly. You can create up to 255 unique strobe light instances, by naming each dummy as strobe_light1, strobe_light2, ..., up to strobe_light255.
-
๐ light_day โ Day Light (Primary)
Material Color: 0 18 255 -
๐ light_day2 โ Day Light (Secondary)
Material Color: 255 7 128 -
๐ light_night โ Night Light (Primary)
Material Color: 0 16 255 -
๐ light_night2 โ Night Light (Secondary)
Material Color: 255 8 128 -
โณ light_allday โ All Day Light (Primary)
Material Color: 0 17 255 -
โณ light_allday2 โ All Day Light (Secondary)
Material Color: 255 9 128 -
๐
light_<suffix>โ Generic AVS light dummy; ModelExtras treats it as an all-day light. Thelight_emsiren family is handled separately.
โจTIP: You can add an unlimited number of indices for the same light type to create separate configurations in the JSONC, such as "light_night3", "light_allday9", "light_night57" or "light_night72". However, they will not have linked materials, only coronas and shadows. Linked material colors work only for the primary and secondary light dummies.
You can assign a custom texture for any light, which is especially useful when simulating modern LED lighting. In real-world LEDs, the bulb itself is usually clear or white, while the emitted light can be any color.
๐ง To achieve this effect in-game:
- Assign the material with a regular "off" texture, just like you would normally.
- Add a custom
_ontexture tovehiclename.txd, vanillavehicle.txd, or VehFuncsvehicle2.txd.
๐งช Example:
-
led_indicatorโ used as the OFF state (assigned to the model material). -
led_indicator_onโ acts as the ON state (glowing version).
You can place the texture led_indicator_on inside:
-
banshee.txdโ per-vehicle custom glow. -
vehicle.txdโ shared glow for multiple vehicles. -
vehicle2.txdโ shared glow for multiple vehicles with VehFuncs feature.
๐ Notice: If both TXDs contain a texture with the same name, the version in vehiclename.txd will take priority.
Deactivates a light when a specific vehicle body part is damaged or detached. Simply place the light dummy as a child of the respective damageable node in the model hierarchy.
๐งช Example: Placing the revl_l dummy as a child of the boot_dummy node deactivates the left reverse light when the vehicle's boot is damaged or opens.
๐จ This method is for compatibility with older ImVehFt-adapted vehicles. Prefer switching to JSONC configuration for richer features and stability.
๐ง Parameters format: _prmRRGGBBXYZ
๐ Dummy name limit: Keep it under 23 characters to avoid crashes.
๐น RR: Red color (HEX)
๐น GG: Green color (HEX)
๐น BB: Blue color (HEX)
๐น X: Light type (0: Directional, 1: Inversed-Directional, 2: Non-Directional)
๐น Y: Corona size (0-9)
๐น Z: Shadow size (0-9)
Instead of renaming nodes in the model, use a JSONC file stored in ModelExtras/data/ or anywhere in modloader/:
๐ Path: ModelExtras/data/<FILENAME>.jsonc or modloader/AnyFolder/<FILENAME>.jsonc
Both model ID and model name are valid FILENAME (e.g. 602.jsonc or alpha.jsonc).
๐กTip: It is recommended to use model names instead of model IDs to avoid conflicts with other mods โ especially when using added vehicles.
Every JSONC configuration requires a metadata specification before any other settings. See here: METADATA
๐ YOUR_DUMMY_NAME must match the model node/dummy name (e.g., indicator_lr, fogl_l, revl_r, taillights). For a strobe, put strobedelay inside that strobe's entry, such as "strobe_light1": { "strobedelay": 250 }.
- It must be the same name that exists in the model. If there is a
_prmparameter in the dummy name, it should be ignored. JSONC will override it. - You do not need to assign all parameters to every dummy. Omitted parameters use default configurations.
Defines the transition / fade-out time (in seconds) simulating incandescent and halogen bulb filament cooldown.
-
Global Scope:
"lights": { "inertia": 0.45 }applies to all lights on the vehicle unless overridden. -
Per-Light Scope:
"taillights": { "inertia": 0.45 }overrides inertia specifically for that light. -
Instant LED Lights: Set
"inertia": 0.0for modern crisp LED indicators, strobes, or emergency flashers.
Defines the delay time for a strobe dummy in milliseconds (e.g. 100, 250, 500). Put it inside that dummy's lights entry. A root-level lights.strobedelay value is not read.
ModelExtras allows independently customizing both the active (ON) and idle (OFF) appearance of the 3D vehicle light mesh material, completely separate from floating corona flares.
Defines the emissive tint applied to the 3D mesh material when the light is turned ON:
"material": {
"color": { "red": 255, "green": 212, "blue": 95 }
}Also supports HEX strings ("#FFD45F", "0xFFD45F") and RGB arrays ([255, 212, 95]).
Defines the tint applied to the 3D mesh material when the light is turned OFF:
"material": {
"color_off": { "red": 40, "green": 40, "blue": 40 }
}๐ก Decoupled Architecture: Corona flare colors (
corona.color) only affect the floating glow effect and ground pointlights. They do not alter the 3D mesh material color. To tint the vehicle's glass or light lens itself, define the"material"block.
Define the corona brightness settings:
Defines corona color. red, green, blue, alpha (0โ255).
Defines the size scale of the light corona (e.g. 0.2, 0.35, 0.5).
Sets the corona viewing direction:
-
directional: Visible primarily from the direction the dummy is pointing. -
inversed-directional: Reverse corona display. Lights in the opposite direction (useful for rear-facing auxiliary lights). -
non-directional: The light is visible from all angles.
Defines the settings for the ground light shadow projection.
๐ Detail: Shadows for secondary dummies taillights2 and headlights2 are disabled by default. Putting a "shadow" section inside their JSONC entry will force enable it.
Defines shadow color. If omitted, inherits the corona color.
By default, ModelExtras casts shadows only outward from the vehicle, relative to its center. Set this to true to allow unrestricted 360ยฐ shadow orientation.
Defines the size scale of the ground shadow (e.g. 0.8, 1.0, 1.5).
Shadow texture loaded from me_texdb.txd (e.g. round, pointlight, foglight, taillight, narrow, tightfocused, spotlight).
โจโ TIP: Some shadows of lights are stretched within the code, like turn lights. So, the
pointlighttexture may appear oval-shaped. To fix this, use theovaltexture to counteract the stretching, making it truly round in the game.
Defines a 2D positional displacement for the ground shadow projection relative to the light dummy point. This is particularly useful when dummies are placed deep inside bumper/headlamp recesses or when ground shadows need precise forward/backward or lateral alignment.
Supported formats:
-
Number (Y axis offset / forward-backward):
"offset": 0.5
-
Object (X and Y axis offsets):
"offset": { "x": -0.15, "y": 0.5 }
-
Array (
[X, Y]):"offset": [-0.15, 0.5]
{ "lights": { "inertia": 0.45, // Global halogen bulb fade-in / fade-out time (seconds). Set 0.0 for instant LED response. "YOUR_DUMMY_NAME": { "inertia": 0.45, // Per-light override for halogen bulb fade time "material": { "color": { "red": 255, "green": 212, "blue": 95 }, // Custom RGB color applied to mesh material when light is ON "color_off": { "red": 40, "green": 40, "blue": 40 } // Custom RGB color applied to mesh material when light is OFF }, "corona": { "color": { "red": 255, "green": 212, "blue": 95, "alpha": 85 }, "size": 0.4, "type": "directional" }, "shadow": { "color": { "red": 255, "green": 200, "blue": 80, "alpha": 70 }, "rotationchecks": true, "size": 1.1, "texture": "headlight_short", "offset": { "x": 0.0, "y": 0.5 } // 2D ground shadow offset (supports number, object {x, y}, or array [x, y]) } } } }