From 9da875c8ba7b27d8ff665b8923ecfd687f3b8431 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 21 Feb 2026 02:49:26 -0800 Subject: [PATCH] Fix elven lantern glow cards rendering as flat disks - route small lantern/lamp/torch/candle emissive batches to glow-sprite path - broaden light-emitter detection beyond additive-only blend modes - add a secondary wider low-alpha halo layer for softer glow falloff - keep elven-style lantern tint in cool blue while preserving warm tint elsewhere This avoids rendering hard flat glow planes and restores a softer volumetric-looking lantern glow. --- src/rendering/m2_renderer.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/rendering/m2_renderer.cpp b/src/rendering/m2_renderer.cpp index c7af5fe7..3d8a075a 100644 --- a/src/rendering/m2_renderer.cpp +++ b/src/rendering/m2_renderer.cpp @@ -2101,20 +2101,36 @@ void M2Renderer::render(const Camera& camera, const glm::mat4& view, const glm:: // (lantern housings, posts, etc.) authored so the prop itself remains visible. const bool smallCardLikeBatch = (batch.glowSize <= 1.35f); const bool batchUnlit = (batch.materialFlags & 0x01) != 0; - const bool shouldUseGlowSprite = - !koboldFlameCard && + const bool lightEmitterLikeBatch = + flameLikeModel && !model.isSpellEffect && smallCardLikeBatch && + (batch.blendMode >= 1 || batch.colorKeyBlack || batchUnlit); + const bool shouldUseGlowSprite = + !koboldFlameCard && ((batch.blendMode >= 3) || + lightEmitterLikeBatch || + (flameLikeModel && batchUnlit) || (batch.colorKeyBlack && flameLikeModel && batchUnlit && batch.blendMode >= 1)); if (shouldUseGlowSprite) { if (entry.distSq < 180.0f * 180.0f) { glm::vec3 worldPos = glm::vec3(instance.modelMatrix * glm::vec4(batch.center, 1.0f)); GlowSprite gs; gs.worldPos = worldPos; - gs.color = glm::vec4(1.0f, 0.82f, 0.46f, 1.15f); + const bool elvenLike = + (modelKeyLower.find("elf") != std::string::npos) || + (modelKeyLower.find("elven") != std::string::npos) || + (modelKeyLower.find("quel") != std::string::npos); + gs.color = elvenLike + ? glm::vec4(0.48f, 0.72f, 1.0f, 1.05f) + : glm::vec4(1.0f, 0.82f, 0.46f, 1.15f); gs.size = batch.glowSize * instance.scale * 1.45f; glowSprites_.push_back(gs); + // Add wider, softer halo to avoid hard "disk" look. + GlowSprite halo = gs; + halo.color.a *= 0.42f; + halo.size *= 1.8f; + glowSprites_.push_back(halo); } continue; }