diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-06-28 17:10:17 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-06-28 17:10:17 +1000 |
commit | 54ac208dd5a54c827567a3a86e152680ae7663ea (patch) | |
tree | 86218292795659a558f5ae65a712f1e6ed0e33ea /source/game/StarWorldClient.cpp | |
parent | bb5387fbdb90ec5e3b387ed73718b281b207252b (diff) |
lighting: disable the new additive point light behavior when new lighting is off
Diffstat (limited to 'source/game/StarWorldClient.cpp')
-rw-r--r-- | source/game/StarWorldClient.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/game/StarWorldClient.cpp b/source/game/StarWorldClient.cpp index aa6f293..9e0478a 100644 --- a/source/game/StarWorldClient.cpp +++ b/source/game/StarWorldClient.cpp @@ -1667,29 +1667,32 @@ void WorldClient::lightingCalc() { RectI lightRange = m_pendingLightRange; List<LightSource> lights = std::move(m_pendingLights); List<std::pair<Vec2F, Vec3F>> particleLights = std::move(m_pendingParticleLights); - auto configuration = Root::singleton().configuration(); + auto& root = Root::singleton(); + auto configuration = root.configuration(); + bool newLighting = configuration->get("newLighting").optBool().value(true); bool monochrome = configuration->get("monochromeLighting").toBool(); + m_lightingCalculator.setParameters(root.assets()->json("/lighting.config:lighting").set("pointAdditive", newLighting)); m_lightingCalculator.setMonochrome(monochrome); m_lightingCalculator.begin(lightRange); lightingTileGather(); prepLocker.unlock(); - bool useHybridPointLights = configuration->get("newObjectLighting").optBool().value(true); for (auto const& light : lights) { Vec2F position = m_geometry.nearestTo(Vec2F(m_lightingCalculator.calculationRegion().min()), light.position); if (light.type == LightType::Spread) m_lightingCalculator.addSpreadLight(position, light.color); else { if (light.type == LightType::PointAsSpread) { - if (!useHybridPointLights) + if (!newLighting) m_lightingCalculator.addSpreadLight(position, light.color); - else { // hybrid (used for auto-converted object lights) - 85% spread, 15% point (2nd is applied elsewhere) + else { // hybrid (used for auto-converted object lights) - 85% spread, 15% point (* .15 is applied in the calculation code) m_lightingCalculator.addSpreadLight(position, light.color * 0.85f); m_lightingCalculator.addPointLight(position, light.color, light.pointBeam, light.beamAngle, light.beamAmbience, true); } - } else // fully additive point light + } else { m_lightingCalculator.addPointLight(position, light.color, light.pointBeam, light.beamAngle, light.beamAmbience); + } } } |