From ae8fa47a23bb1ae4e407bf32cdce495e249b88da Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 23 Jul 2026 01:07:47 -0700 Subject: [PATCH] diag: report flame emitters that never fire A lamp whose emitter yields a zero rate or lifespan glows but shows no flame, which is indistinguishable from a rendering problem. Log each such model once, at warning level so a default log captures it, with the track state that produced the zero. --- src/rendering/m2_renderer_particles.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/rendering/m2_renderer_particles.cpp b/src/rendering/m2_renderer_particles.cpp index ed3e7204..ccd36a04 100644 --- a/src/rendering/m2_renderer_particles.cpp +++ b/src/rendering/m2_renderer_particles.cpp @@ -1,4 +1,5 @@ #include "rendering/m2_renderer.hpp" +#include #include "rendering/m2_renderer_internal.h" #include "rendering/vk_context.hpp" #include "rendering/vk_buffer.hpp" @@ -100,7 +101,25 @@ void M2Renderer::emitParticles(M2Instance& inst, const M2ModelGPU& gpu, float dt inst.currentSequenceIndex, gpu.globalSequenceDurations); float life = interpFloat(em.lifespan, inst.animTime, inst.globalSequenceTime, inst.currentSequenceIndex, gpu.globalSequenceDurations); - if (rate <= 0.0f || life <= 0.0f) continue; + if (rate <= 0.0f || life <= 0.0f) { + // Diagnostic: a lamp or flame whose emitter never fires produces a + // fixture that glows but shows no flame. Report each model once so a + // default-level log says whether emission is the cause. + if (gpu.isLanternLike || gpu.isTorch || gpu.isBrazierOrFire) { + static std::unordered_set reported; + if (reported.insert(gpu.name).second) { + LOG_WARNING("Flame emitter idle: '", gpu.name, "' emitter=", ei, + " rate=", rate, " life=", life, + " animTime=", inst.animTime, + " seqIdx=", inst.currentSequenceIndex, + " gsTime=", inst.globalSequenceTime, + " rateSeqs=", em.emissionRate.sequences.size(), + " lifeSeqs=", em.lifespan.sequences.size(), + " rateGlobalSeq=", em.emissionRate.globalSequence); + } + } + continue; + } inst.emitterAccumulators[ei] += rate * dt;