Vehicle Lights - user-grinch/ModelExtras GitHub Wiki

๐Ÿšฆ Overview

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).


๐ŸŽฎ Key Controls

๐Ÿ”„ Indicator Lights

  • โฌ…๏ธ Z: Left turn signal
  • โน Left Shift: Turns off indicators
  • ๐Ÿ”ƒ X: Activates hazard lights (both turn signals)
  • โžก๏ธ C: Right turn signal

๐Ÿ”ง Miscellaneous

  • โ˜๏ธ J: Toggles fog lights
  • ๐Ÿ’ก G: Toggles long headlights (high beams)
  • ๐ŸŒ† B: Toggles Spotlights
  • โžถ RMB: Rotates Spotlights

โœจ Variants & Advanced Lighting Features

๐Ÿ”„ Indicator Lights & Auto-Turn

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 = 1 in ModelExtras.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.

๐Ÿš— Global Indicator Lights (Non-Adapted Vehicles)

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!

๐Ÿ’ก High Beams & Volumetric Light Beams (HeadLightBeams)

  • 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 = 1 under [LIGHTS] in ModelExtras.ini to render classic volumetric light beam cones extending from the headlights.

๐Ÿ’ก Dynamic Real-Time Point Lights & 3D Leaning Shadows

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 & Smart Weather Activation

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 = 1 in ModelExtras.ini), fog lights will only turn on if main headlights are active. Set to 0 for completely independent toggle.
  • Note: FogLights don't cast shadows by default. Specify size in JSONC or _prm to enable ground shadows.

๐Ÿ”™ Reverse Lights

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 & Player Idle Brake Lights

  • 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 = 1 in ModelExtras.ini), the player's brake lights automatically remain illuminated while the vehicle is stopped and idling, releasing smoothly upon throttle input.

๐Ÿ’ก Pop-Up Headlights (Opening Delay Synchronization)

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.

๐Ÿ“› North America - Dual Setup

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.

๐ŸŒŸ STT Lights โ€“ Old-School Single-Bulb Setup

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

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

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

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.

โ˜€๏ธ Other Light Types

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.


๐Ÿท๏ธ Node (dummy), Naming & Material Colors (RGB)

๐Ÿ’ก Headlights

  • โšช 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

  • ๐Ÿ”ด 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.

๐Ÿšฅ Turn Signals

  • ๐Ÿ”ธ 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

๐ŸŒซ๏ธ Fog Lights

  • โšช foglight_l / fogl_l โ†’ Left Fog Light Material Color: 255 174 0
  • โšช foglight_r / fogl_r โ†’ Right Fog Light Material Color: 0 255 199

๐Ÿ”™ Reverse Lights

  • โฌ…๏ธ revl_l / reversingl_l / reversinglight_l โ†’ Left Reverse Light Material Color: 255 173 0
  • โžก๏ธ revl_r / reversingl_r / reversinglight_r โ†’ Right Reverse Light Material Color: 0 255 198

๐Ÿ›‘ Brake Lights

  • ๐Ÿ”ด breaklight_l / breakl_l โ†’ Left Brake Light Material Color: 184 255 0
  • ๐Ÿ”ด breaklight_r / breakl_r โ†’ Right Brake Light Material Color: 255 59 0

๐Ÿšฅ Side Lights

  • โฌ…๏ธ sidelight_l โ†’ Left Side Light Material Color: 255 200 1
  • โžก๏ธ sidelight_r โ†’ Right Side Light Material Color: 255 200 2

๐ŸŒŸ STT Lights

  • โฌ…๏ธ sttlight_l โ†’ Left STT Light Material Color: 255 200 3
  • โžก๏ธ sttlight_r โ†’ Right STT Light Material Color: 255 200 4

๐Ÿ“› NA Brake Lights

  • ๐Ÿ”ด nabrakelight_l โ†’ Left Brake Light Material Color: 255 200 5
  • ๐Ÿ”ด nabrakelight_r โ†’ Right Brake Light Material Color: 255 200 6

๐Ÿงฟโ€‹ Spotlights

  • ๐Ÿ”ฆ spotlight_lightX โ†’ X can 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 Lights

  • โšก 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.

โ˜€๏ธ Other Light Types

  • ๐Ÿ”† 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. The light_em siren 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.


๐ŸŽจ Custom ON Textures for Lights

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:

  1. Assign the material with a regular "off" texture, just like you would normally.
  2. Add a custom _on texture to vehiclename.txd, vanilla vehicle.txd, or VehFuncs vehicle2.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.


๐Ÿ’ฅโ€‹ Damage Detection

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.


โš™๏ธ Configuration _prm (Legacy)

๐Ÿšจ 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)


โš™๏ธ Configuration (Recommended JSONC)

Instead of renaming nodes in the model, use a JSONC file stored in ModelExtras/data/ or anywhere in modloader/:

๐Ÿ“‚ File Location & Structure

๐Ÿ“Œ 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.

โš ๏ธโ€‹ Attention:

Every JSONC configuration requires a metadata specification before any other settings. See here: METADATA

{
  "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])
       }
     }
  }
}

๐Ÿ“Œ 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 _prm parameter 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.

โšก Inertia (inertia)

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.0 for modern crisp LED indicators, strobes, or emergency flashers.

๐Ÿ•’ Strobe Delay (strobedelay)

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.


๐ŸŽจ Material Colors (material)

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.

๐Ÿ’ก Material On Color (color)

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]).

๐ŸŒ™ Material Off Color (color_off)

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.


๐Ÿ’ก Corona

Define the corona brightness settings:

๐ŸŽจ Color

Defines corona color. red, green, blue, alpha (0โ€“255).

๐Ÿ”† Size

Defines the size scale of the light corona (e.g. 0.2, 0.35, 0.5).

๐Ÿ”ƒ Type

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.

โšซ Shadow

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.

๐ŸŽจ Color

Defines shadow color. If omitted, inherits the corona color.

๐Ÿ”„ rotationchecks

By default, ModelExtras casts shadows only outward from the vehicle, relative to its center. Set this to true to allow unrestricted 360ยฐ shadow orientation.

๐Ÿ”† Size

Defines the size scale of the ground shadow (e.g. 0.8, 1.0, 1.5).

๐Ÿ–ผ๏ธ Texture

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 pointlight texture may appear oval-shaped. To fix this, use the oval texture to counteract the stretching, making it truly round in the game.

๐Ÿ“ offset

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]

โš ๏ธ **GitHub.com Fallback** โš ๏ธ