From a7b2d8b433f819612ccfafaa3b158bf5107c36c7 Mon Sep 17 00:00:00 2001 From: Caner Karaca Date: Sun, 20 Sep 2026 16:29:24 +0300 Subject: [PATCH] feat(lights): add independent high beam dummy nodes and material colors --- src/ModelExtrasAPI.h | 2 + src/enums/materialtype.h | 2 + src/features/core/colors.h | 3 + src/features/lights/components/headlight.cpp | 123 ++++++++++++++---- src/features/lights/components/tail_light.cpp | 7 +- src/features/lights/damage.h | 8 +- src/features/lights/data.h | 2 - src/features/lights/manager.cpp | 25 +++- src/utils/render.cpp | 11 +- 9 files changed, 141 insertions(+), 42 deletions(-) diff --git a/src/ModelExtrasAPI.h b/src/ModelExtrasAPI.h index 530d20ca..d7770857 100755 --- a/src/ModelExtrasAPI.h +++ b/src/ModelExtrasAPI.h @@ -78,6 +78,8 @@ enum ME_LightID ME_ReverseLightRight, ME_BrakeLightLeft, ME_BrakeLightRight, + ME_HighBeamLeft, + ME_HighBeamRight, ME_AllDayLight, ME_DayLight, ME_NightLight, diff --git a/src/enums/materialtype.h b/src/enums/materialtype.h index be6aded0..600abe81 100755 --- a/src/enums/materialtype.h +++ b/src/enums/materialtype.h @@ -15,6 +15,8 @@ enum eMaterialType ReverseLightRight, BrakeLightLeft, BrakeLightRight, + HighBeamLeft, + HighBeamRight, AllDayLight, DayLight, NightLight, diff --git a/src/features/core/colors.h b/src/features/core/colors.h index 2eef02f5..36d8565d 100755 --- a/src/features/core/colors.h +++ b/src/features/core/colors.h @@ -9,6 +9,9 @@ #define VEHCOL_HEADLIGHT_LEFT CRGBA(255, 175, 0, 255) #define VEHCOL_HEADLIGHT_RIGHT CRGBA(0, 255, 200, 255) +#define VEHCOL_HIGHBEAM_LEFT CRGBA(255, 172, 0, 255) +#define VEHCOL_HIGHBEAM_RIGHT CRGBA(0, 255, 197, 255) + #define VEHCOL_TAILLIGHT_LEFT CRGBA(185, 255, 0, 255) #define VEHCOL_TAILLIGHT_RIGHT CRGBA(255, 60, 0, 255) diff --git a/src/features/lights/components/headlight.cpp b/src/features/lights/components/headlight.cpp index 4ea96454..1cd8834b 100644 --- a/src/features/lights/components/headlight.cpp +++ b/src/features/lights/components/headlight.cpp @@ -12,11 +12,15 @@ extern bool gbProperShadersDetected; void HeadlightComponent::RegisterMaterials(std::unordered_map& matMap) { matMap[VEHCOL_HEADLIGHT_LEFT.ToInt()] = eMaterialType::HeadLightLeft; matMap[VEHCOL_HEADLIGHT_RIGHT.ToInt()] = eMaterialType::HeadLightRight; + matMap[VEHCOL_HIGHBEAM_LEFT.ToInt()] = eMaterialType::HighBeamLeft; + matMap[VEHCOL_HIGHBEAM_RIGHT.ToInt()] = eMaterialType::HighBeamRight; } eMaterialType HeadlightComponent::GetMatType(CRGBA matCol) { if (matCol == VEHCOL_HEADLIGHT_LEFT) return eMaterialType::HeadLightLeft; if (matCol == VEHCOL_HEADLIGHT_RIGHT) return eMaterialType::HeadLightRight; + if (matCol == VEHCOL_HIGHBEAM_LEFT) return eMaterialType::HighBeamLeft; + if (matCol == VEHCOL_HIGHBEAM_RIGHT) return eMaterialType::HighBeamRight; return eMaterialType::UnknownMaterial; } @@ -73,6 +77,72 @@ bool HeadlightComponent::TryRegisterDummy(CVehicle* pVeh, RwFrame* pFrame, const return true; } + if (name == "headlight_l" || name == "headlight_r") { + if (pFrame && !rwLinkListEmpty(&pFrame->objectList)) { + return false; + } + DummyConfig c = LightManager::CreateBaseConfig(pVeh, pFrame); + c.dummyPos = eDummyPos::Front; + c.lightType = (name == "headlight_l") ? eMaterialType::HeadLightLeft : eMaterialType::HeadLightRight; + c.corona.size = LightsConfig::Get().gfHeadLightCoronaSize; + c.corona.color = {250, 250, 250, static_cast(LightsConfig::Get().gHeadLightCoronaIntensity)}; + c.shadow.color = {250, 250, 250, static_cast(LightsConfig::Get().gHeadLightShadowIntensity)}; + c.shadow.size = LightsConfig::Get().gfHeadLightShadowSize; + c.corona.lightingType = eLightingMode::Directional; + c.shadow.render = true; + c.mirroredX = false; + + data.dummies[c.lightType].push_back(VehicleDummy(c)); + return true; + } + + if (name == "highbeam_l" || name == "highbeam_r" || name == "highbeams_l" || name == "highbeams_r") { + if (pFrame && !rwLinkListEmpty(&pFrame->objectList)) { + return false; + } + DummyConfig c = LightManager::CreateBaseConfig(pVeh, pFrame); + c.dummyPos = eDummyPos::Front; + bool isLeft = (name == "highbeam_l" || name == "highbeams_l"); + c.lightType = isLeft ? eMaterialType::HighBeamLeft : eMaterialType::HighBeamRight; + c.corona.size = LightsConfig::Get().gfHeadLightCoronaSize; + c.corona.color = {250, 250, 250, static_cast(LightsConfig::Get().gHeadLightCoronaIntensity)}; + c.shadow.color = {250, 250, 250, static_cast(LightsConfig::Get().gHeadLightShadowIntensity)}; + c.shadow.size = LightsConfig::Get().gfHeadLightShadowSize; + c.corona.lightingType = eLightingMode::Directional; + c.shadow.render = false; + c.mirroredX = false; + + data.dummies[c.lightType].push_back(VehicleDummy(c)); + return true; + } + + if (name == "highbeam" || name == "highbeams") { + if (pFrame && !rwLinkListEmpty(&pFrame->objectList)) { + return false; + } + DummyConfig c = LightManager::CreateBaseConfig(pVeh, pFrame); + c.dummyPos = eDummyPos::Front; + c.corona.size = LightsConfig::Get().gfHeadLightCoronaSize; + c.corona.color = {250, 250, 250, static_cast(LightsConfig::Get().gHeadLightCoronaIntensity)}; + c.shadow.color = {250, 250, 250, static_cast(LightsConfig::Get().gHeadLightShadowIntensity)}; + c.shadow.size = LightsConfig::Get().gfHeadLightShadowSize; + c.corona.lightingType = eLightingMode::Directional; + c.shadow.render = false; + + bool dummyIsLeft = (c.frame->modelling.pos.x < 0.0f); + + c.mirroredX = !dummyIsLeft; + c.lightType = eMaterialType::HighBeamLeft; + data.dummies[eMaterialType::HighBeamLeft].push_back(VehicleDummy(c)); + + if (pVeh->m_nVehicleSubClass != VEHICLE_BIKE || std::abs(c.frame->modelling.pos.x) > 0.05f) { + c.mirroredX = dummyIsLeft; + c.lightType = eMaterialType::HighBeamRight; + data.dummies[eMaterialType::HighBeamRight].push_back(VehicleDummy(c)); + } + return true; + } + std::string lowerName; lowerName.reserve(name.size()); for (char ch : name) { @@ -98,7 +168,7 @@ void HeadlightComponent::Process(CVehicle* pVeh, VehLightData& data) { } if (pVeh->IsDriver(FindPlayerPed())) { - if (!isHeadlightsActive && data.fLightFactor[eMaterialType::HeadLightLeft] <= 0.001f) { + if (!isHeadlightsActive && data.fLightFactor[eMaterialType::HeadLightLeft] <= 0.001f && data.fLightFactor[eMaterialType::HeadLightRight] <= 0.001f) { data.bLongLightsOn = false; } @@ -107,26 +177,6 @@ void HeadlightComponent::Process(CVehicle* pVeh, VehLightData& data) { data.bLongLightsOn = !data.bLongLightsOn; AudioMgr::PlaySwitchSound(pVeh); } - } else if (pVeh->m_fHealth > 0.0f) { - if (CarUtil::IsLightsForcedOff(pVeh) || (Util::IsEngineOff(pVeh) && !CarUtil::IsLightsForcedOn(pVeh) && !pVeh->bLightsOn && !isAlarmActive)) { - return; - } - - if (CVector::Distance(pVeh->GetPosition(), TheCamera.GetPosition()) < 300.0f || pVeh->GetIsOnScreen()) { - bool isLeftFrontOk = !Util::IsLightDamaged(pVeh, eLights::LIGHT_FRONT_LEFT); - bool isRightFrontOk = !Util::IsLightDamaged(pVeh, eLights::LIGHT_FRONT_RIGHT); - - if (isHeadlightsActive && AreHeadlightsOpen(pVeh, data)) { - bool isFoggy = Util::IsFoggy(); - std::string texName = data.bLongLightsOn ? "headlight_long" : "headlight_short"; - bool shadow = !gbProperShadersDetected; - bool highlight = isFoggy || data.bLongLightsOn; - - LightManager::RenderLight(pVeh, data, eMaterialType::HeadLightLeft, isLeftFrontOk, shadow ? texName : "", LightsConfig::Get().headlightSz, highlight); - LightManager::RenderLight(pVeh, data, eMaterialType::HeadLightRight, isRightFrontOk, shadow ? texName : "", LightsConfig::Get().headlightSz, highlight); - data.nHeadlightTickFrame = CTimer::m_FrameCounter; - } - } } } @@ -150,7 +200,6 @@ void HeadlightComponent::Render(CVehicle* pControlVeh, CVehicle* pTowedVeh, VehL bool isHeadlightLeftOk = damage.isHeadlightLeftOk; bool isHeadlightRightOk = damage.isHeadlightRightOk; - bool bTickRegistered = (data.nHeadlightTickFrame == CTimer::m_FrameCounter); bool isFoggy = Util::IsFoggy(); std::string texName = data.bLongLightsOn ? "headlight_long" : "headlight_short"; bool shadow = !gbProperShadersDetected; @@ -160,10 +209,16 @@ void HeadlightComponent::Render(CVehicle* pControlVeh, CVehicle* pTowedVeh, VehL pControlVeh->m_renderLights.m_bLeftFront = isHeadlightLeftOk; pControlVeh->m_renderLights.m_bRightFront = isHeadlightRightOk; if (isHeadlightLeftOk) { - LightManager::RenderLights(pControlVeh, pTowedVeh, data, eMaterialType::HeadLightLeft, true, shadow ? texName : "", LightsConfig::Get().headlightSz, highlight, true, bTickRegistered); + LightManager::RenderLights(pControlVeh, pTowedVeh, data, eMaterialType::HeadLightLeft, true, shadow ? texName : "", LightsConfig::Get().headlightSz, highlight, true); + if (data.bLongLightsOn) { + LightManager::RenderLights(pControlVeh, pTowedVeh, data, eMaterialType::HighBeamLeft, true, "", LightsConfig::Get().headlightSz, isFoggy, true); + } } if (isHeadlightRightOk) { - LightManager::RenderLights(pControlVeh, pTowedVeh, data, eMaterialType::HeadLightRight, true, shadow ? texName : "", LightsConfig::Get().headlightSz, highlight, true, bTickRegistered); + LightManager::RenderLights(pControlVeh, pTowedVeh, data, eMaterialType::HeadLightRight, true, shadow ? texName : "", LightsConfig::Get().headlightSz, highlight, true); + if (data.bLongLightsOn) { + LightManager::RenderLights(pControlVeh, pTowedVeh, data, eMaterialType::HighBeamRight, true, "", LightsConfig::Get().headlightSz, isFoggy, true); + } } } } @@ -192,6 +247,26 @@ void HeadlightComponent::ProcessPointLights(CVehicle* pVeh, VehLightData& data) RenderUtil::RegisterHeadlightPointLight(&e->Get(), rangeMul); } } + + if (data.bLongLightsOn) { + for (eMaterialType type : {eMaterialType::HighBeamLeft, eMaterialType::HighBeamRight}) { + if (!LightManager::IsDummyAvailable(data, type) || !data.bLightStates[type]) { + continue; + } + + bool isLeft = (type == eMaterialType::HighBeamLeft); + eLights lightEnum = isLeft ? eLights::LIGHT_FRONT_LEFT : eLights::LIGHT_FRONT_RIGHT; + ePanels wingEnum = isLeft ? ePanels::WING_FRONT_LEFT : ePanels::WING_FRONT_RIGHT; + if (Util::IsLightDamaged(pVeh, lightEnum) || Util::IsPanelDamaged(pVeh, wingEnum)) { + continue; + } + + for (auto& e : data.dummies[type]) { + e->Update(); + RenderUtil::RegisterHeadlightPointLight(&e->Get(), rangeMul); + } + } + } } } diff --git a/src/features/lights/components/tail_light.cpp b/src/features/lights/components/tail_light.cpp index d9baf302..eb003f20 100644 --- a/src/features/lights/components/tail_light.cpp +++ b/src/features/lights/components/tail_light.cpp @@ -28,11 +28,14 @@ bool TailLightComponent::TryRegisterDummy(CVehicle* pVeh, RwFrame* pFrame, const c.shadow.size = LightsConfig::Get().gfTailLightShadowSize; c.corona.lightingType = eLightingMode::Directional; c.shadow.render = name != "taillights2"; - c.mirroredX = false; + bool dummyIsLeft = (c.frame->modelling.pos.x < 0.0f); + + c.mirroredX = dummyIsLeft; + c.lightType = eMaterialType::TailLightRight; data.dummies[c.lightType].push_back(VehicleDummy(c)); if (pVeh->m_nVehicleSubClass != VEHICLE_BIKE || std::abs(c.frame->modelling.pos.x) > 0.05f) { - c.mirroredX = true; + c.mirroredX = !dummyIsLeft; c.lightType = eMaterialType::TailLightLeft; data.dummies[c.lightType].push_back(VehicleDummy(c)); } diff --git a/src/features/lights/damage.h b/src/features/lights/damage.h index 6fdce7ff..1dc78ec0 100644 --- a/src/features/lights/damage.h +++ b/src/features/lights/damage.h @@ -15,12 +15,12 @@ struct LightDamageState { static LightDamageState Get(CVehicle* pControlVeh, CVehicle* pTowedVeh) { LightDamageState state; - state.isHeadlightLeftOk = !(Util::IsLightDamaged(pControlVeh, eLights::LIGHT_FRONT_LEFT) || Util::IsPanelDamaged(pControlVeh, ePanels::WING_FRONT_LEFT)); - state.isHeadlightRightOk = !(Util::IsLightDamaged(pControlVeh, eLights::LIGHT_FRONT_RIGHT) || Util::IsPanelDamaged(pControlVeh, ePanels::WING_FRONT_RIGHT)); + state.isHeadlightLeftOk = !Util::IsLightDamaged(pControlVeh, eLights::LIGHT_FRONT_LEFT); + state.isHeadlightRightOk = !Util::IsLightDamaged(pControlVeh, eLights::LIGHT_FRONT_RIGHT); state.isFrontLeftOk = state.isHeadlightLeftOk || pControlVeh->bSirenOrAlarm; state.isFrontRightOk = state.isHeadlightRightOk || pControlVeh->bSirenOrAlarm; - state.isRearLeftOk = !(Util::IsLightDamaged(pTowedVeh, eLights::LIGHT_REAR_LEFT) || Util::IsPanelDamaged(pTowedVeh, ePanels::WING_REAR_LEFT)); - state.isRearRightOk = !(Util::IsLightDamaged(pTowedVeh, eLights::LIGHT_REAR_RIGHT) || Util::IsPanelDamaged(pTowedVeh, ePanels::WING_REAR_RIGHT)); + state.isRearLeftOk = !Util::IsLightDamaged(pTowedVeh, eLights::LIGHT_REAR_LEFT); + state.isRearRightOk = !Util::IsLightDamaged(pTowedVeh, eLights::LIGHT_REAR_RIGHT); state.isMiddleLeftOk = !Util::IsPanelDamaged(pControlVeh, ePanels::WING_FRONT_LEFT); state.isMiddleRightOk = !Util::IsPanelDamaged(pControlVeh, ePanels::WING_FRONT_RIGHT); state.isFrontBumperOk = !Util::IsPanelDamaged(pControlVeh, ePanels::BUMP_FRONT); diff --git a/src/features/lights/data.h b/src/features/lights/data.h index 18bffe86..56bfd897 100644 --- a/src/features/lights/data.h +++ b/src/features/lights/data.h @@ -126,7 +126,6 @@ struct VehLightData { std::array, eMaterialType::TotalMaterial> dummies; bool bLightStates[eMaterialType::TotalMaterial]; - unsigned int nHeadlightTickFrame = 0; bool bHasVehFuncsPopUp = false; std::array fLightFactor = {}; std::array bLightRenderedThisFrame = {}; @@ -161,7 +160,6 @@ struct VehLightData { vec.clear(); } std::copy(std::begin(other.bLightStates), std::end(other.bLightStates), std::begin(bLightStates)); - nHeadlightTickFrame = other.nHeadlightTickFrame; } return *this; } diff --git a/src/features/lights/manager.cpp b/src/features/lights/manager.cpp index 9cc56483..2f4eb26c 100644 --- a/src/features/lights/manager.cpp +++ b/src/features/lights/manager.cpp @@ -153,12 +153,14 @@ void LightManager::Render(CVehicle* pControlVeh, CVehicle* pTowedVeh) { RwFrame *parent = RwFrameGetParent(dummy->Get().frame); bool isBike = pVeh->m_nVehicleSubClass == VEHICLE_BIKE; bool isDamaged = Util::IsFrameDamaged(pVeh, parent) || !FrameUtil::IsOkAtomicVisible(parent); - bool atomicCheck = !isBike && pVeh->GetIsOnScreen() && type != eMaterialType::HeadLightLeft && type != eMaterialType::HeadLightRight && isDamaged; + bool atomicCheck = !isBike && pVeh->GetIsOnScreen() && type != eMaterialType::HeadLightLeft && type != eMaterialType::HeadLightRight && type != eMaterialType::HighBeamLeft && type != eMaterialType::HighBeamRight && isDamaged; if (atomicCheck || (c.dummyPos == eDummyPos::Rear && pVeh->m_pTrailer)) continue; float szMul = 1.0f; if (type == eMaterialType::HeadLightLeft || type == eMaterialType::HeadLightRight) { - szMul = 1.0f + 2.0f * vData.fHighBeamFactor; + if (!LightManager::IsDummyAvailable(vData, {eMaterialType::HighBeamLeft, eMaterialType::HighBeamRight})) { + szMul = 1.0f + 2.0f * vData.fHighBeamFactor; + } } EnableDummy((int)pVeh + 42 + id++, &dummy, pVeh, szMul, factor); @@ -171,7 +173,9 @@ void LightManager::Render(CVehicle* pControlVeh, CVehicle* pTowedVeh) { } } } else { - if (type == eMaterialType::HeadLightLeft || type == eMaterialType::HeadLightRight) { + if ((type == eMaterialType::HeadLightLeft || type == eMaterialType::HeadLightRight) && + vData.fLightFactor[eMaterialType::HeadLightLeft] <= 0.001f && + vData.fLightFactor[eMaterialType::HeadLightRight] <= 0.001f) { vData.fHighBeamFactor = 0.0f; vData.bLongLightsOn = false; } @@ -215,7 +219,7 @@ void LightManager::RenderLight(CVehicle* pVeh, VehLightData& data, eMaterialType } bool isAvailable = IsDummyAvailable(data, type); - if (type == eMaterialType::HeadLightLeft) { + if (type == eMaterialType::HeadLightLeft || (type == eMaterialType::HeadLightRight && data.fLightFactor[eMaterialType::HeadLightLeft] <= 0.001f)) { float target = (data.bLongLightsOn && isOn) ? 1.0f : 0.0f; if (inertia > 0.0001f) { float hbStep = (CTimer::ms_fTimeStep / 50.0f) / inertia; @@ -248,7 +252,7 @@ void LightManager::RenderLight(CVehicle* pVeh, VehLightData& data, eMaterialType if (!isDamaged && parent) { isDamaged = !FrameUtil::IsOkAtomicVisible(parent); } - bool atomicCheck = !isBike && pVeh->GetIsOnScreen() && type != eMaterialType::HeadLightLeft && type != eMaterialType::HeadLightRight && isDamaged; + bool atomicCheck = !isBike && pVeh->GetIsOnScreen() && type != eMaterialType::HeadLightLeft && type != eMaterialType::HeadLightRight && type != eMaterialType::HighBeamLeft && type != eMaterialType::HighBeamRight && isDamaged; if (atomicCheck || (c.dummyPos == eDummyPos::Rear && pVeh->m_pTrailer) || !isDummyOk) { continue; @@ -276,7 +280,9 @@ void LightManager::RenderLight(CVehicle* pVeh, VehLightData& data, eMaterialType float szMul = 1.0f; if (type == eMaterialType::HeadLightLeft || type == eMaterialType::HeadLightRight) { - szMul = 1.0f + 2.0f * data.fHighBeamFactor; + if (!LightManager::IsDummyAvailable(data, {eMaterialType::HighBeamLeft, eMaterialType::HighBeamRight})) { + szMul = 1.0f + 2.0f * data.fHighBeamFactor; + } if (highlight && !data.bLongLightsOn) { szMul = std::max(szMul, 3.00f); } @@ -413,6 +419,8 @@ const char* LightManager::GetLightGroupKey(eMaterialType type) { switch (type) { case eMaterialType::HeadLightLeft: case eMaterialType::HeadLightRight: + case eMaterialType::HighBeamLeft: + case eMaterialType::HighBeamRight: return "headlights"; case eMaterialType::TailLightLeft: case eMaterialType::TailLightRight: @@ -455,6 +463,8 @@ const char* LightManager::GetLightSpecificKey(eMaterialType type) { switch (type) { case eMaterialType::HeadLightLeft: return "headlight_l"; case eMaterialType::HeadLightRight: return "headlight_r"; + case eMaterialType::HighBeamLeft: return "highbeam_l"; + case eMaterialType::HighBeamRight: return "highbeam_r"; case eMaterialType::TailLightLeft: return "taillight_l"; case eMaterialType::TailLightRight: return "taillight_r"; case eMaterialType::STTLightLeft: return "sttlight_l"; @@ -564,6 +574,9 @@ MatStateColor LightManager::GetMaterialColor(CVehicle* pVeh, eMaterialType type) if (type == eMaterialType::FogLightRight) checkKey("fogl_r"); if (type == eMaterialType::ReverseLightLeft) { checkKey("revl_l"); checkKey("rev_l"); } if (type == eMaterialType::ReverseLightRight) { checkKey("revl_r"); checkKey("rev_r"); } + if (type == eMaterialType::HighBeamLeft || type == eMaterialType::HighBeamRight) { + checkKey("highbeam"); + } if (grpKey) checkKey(grpKey); } diff --git a/src/utils/render.cpp b/src/utils/render.cpp index 118703b2..abd721d7 100755 --- a/src/utils/render.cpp +++ b/src/utils/render.cpp @@ -153,7 +153,7 @@ void RenderUtil::RegisterHeadlightPointLight(const DummyConfig *pConfig, float r } } - bool isLeft = (pConfig->lightType == eMaterialType::HeadLightLeft || pConfig->position.x < 0.0f); + bool isLeft = (pConfig->lightType == eMaterialType::HeadLightLeft || pConfig->lightType == eMaterialType::HighBeamLeft || pConfig->position.x < 0.0f); eLights lightEnum = isLeft ? eLights::LIGHT_FRONT_LEFT : eLights::LIGHT_FRONT_RIGHT; ePanels wingEnum = isLeft ? ePanels::WING_FRONT_LEFT : ePanels::WING_FRONT_RIGHT; if (Util::IsLightDamaged(pConfig->pVeh, lightEnum) || Util::IsPanelDamaged(pConfig->pVeh, wingEnum)) @@ -237,7 +237,7 @@ void RenderUtil::RegisterPointLight(const DummyConfig *pConfig, CRGBA col, float bool isSirenFlashing = pConfig->pVeh->bSirenOrAlarm; // Front Left - if (pConfig->lightType == eMaterialType::HeadLightLeft || pConfig->lightType == eMaterialType::FogLightLeft) + if (pConfig->lightType == eMaterialType::HeadLightLeft || pConfig->lightType == eMaterialType::HighBeamLeft || pConfig->lightType == eMaterialType::FogLightLeft) { if (Util::IsLightDamaged(pConfig->pVeh, eLights::LIGHT_FRONT_LEFT) || Util::IsPanelDamaged(pConfig->pVeh, ePanels::WING_FRONT_LEFT)) return; @@ -248,7 +248,7 @@ void RenderUtil::RegisterPointLight(const DummyConfig *pConfig, CRGBA col, float return; } // Front Right - else if (pConfig->lightType == eMaterialType::HeadLightRight || pConfig->lightType == eMaterialType::FogLightRight) + else if (pConfig->lightType == eMaterialType::HeadLightRight || pConfig->lightType == eMaterialType::HighBeamRight || pConfig->lightType == eMaterialType::FogLightRight) { if (Util::IsLightDamaged(pConfig->pVeh, eLights::LIGHT_FRONT_RIGHT) || Util::IsPanelDamaged(pConfig->pVeh, ePanels::WING_FRONT_RIGHT)) return; @@ -397,6 +397,7 @@ void RenderUtil::RegisterCoronaDirectional(const DummyConfig *pConfig, float ang { float targetAngle = angle; if (pConfig->lightType == eMaterialType::HeadLightLeft || pConfig->lightType == eMaterialType::HeadLightRight + || pConfig->lightType == eMaterialType::HighBeamLeft || pConfig->lightType == eMaterialType::HighBeamRight || pConfig->lightType == eMaterialType::IndicatorLightLeftFront || pConfig->lightType == eMaterialType::IndicatorLightRightFront) targetAngle = 0.0f; else if (pConfig->lightType == eMaterialType::TailLightLeft || pConfig->lightType == eMaterialType::TailLightRight @@ -445,6 +446,8 @@ static int GetShadowIntensity(eMaterialType lightType) { case eMaterialType::HeadLightLeft: case eMaterialType::HeadLightRight: + case eMaterialType::HighBeamLeft: + case eMaterialType::HighBeamRight: intensity = gnHeadLightShadowIntensity; break; case eMaterialType::TailLightLeft: @@ -483,7 +486,7 @@ void RenderUtil::RegisterShadowDirectional(const DummyConfig *pConfig, const std extern bool gbProperShadersDetected; extern bool gbLightPointLights; - if (gbProperShadersDetected && (gbLightPointLights || pConfig->lightType == eMaterialType::HeadLightLeft || pConfig->lightType == eMaterialType::HeadLightRight)) + if (gbProperShadersDetected && (gbLightPointLights || pConfig->lightType == eMaterialType::HeadLightLeft || pConfig->lightType == eMaterialType::HeadLightRight || pConfig->lightType == eMaterialType::HighBeamLeft || pConfig->lightType == eMaterialType::HighBeamRight)) { return; }