Skip to content

feat(lights): add dynamic vehicle headlight beam colors - #333

Merged
user-grinch merged 1 commit into
user-grinch:mainfrom
CanerKaraca23:feat/dynamic-headlight-beam-colors
Sep 18, 2026
Merged

user-grinch merged 1 commit into
user-grinch:mainfrom
CanerKaraca23:feat/dynamic-headlight-beam-colors

Conversation

@CanerKaraca23

Copy link
Copy Markdown
Collaborator

Overview

This pull request adds dynamic vehicle headlight beam colors to ModelExtras. Previously, the game's native volumetric headlight beam effect (CVehicle::DoHeadLightBeam, address 0x6E0E20) rendered 3D light cones with hardcoded white vertices (255, 255, 255).

Changes

  • Hooked 0x6E0E20 (CVehicle::DoHeadLightBeam) via patch::ReplaceFunction.
  • Modulated vertex colors dynamically using LightManager::GetMaterialColor(pVeh, matType).on, adapting to DFF dummy hex colors (#RRGGBB in node names), material states, and JSONC vehicle configurations ("lights").
  • Automatically preserves vanilla white color for standard vehicles.
  • Retained full compatibility with [LIGHTS] HeadLightBeams toggle in ModelExtras.ini and dynamic live reload (MERELOAD).
  • 100% safe for SA-MP (does not affect SA-MP's vehicle lights / coronas synchronization).

@user-grinch
user-grinch merged commit 5c7f71f into user-grinch:main Sep 18, 2026
@CanerKaraca23
CanerKaraca23 deleted the feat/dynamic-headlight-beam-colors branch September 18, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants