Skip to content

Stop a held torch's head glowing once its flame is out - #123

Draft
sambvfx wants to merge 2 commits into
NVIDIAGameWorks:mainfrom
sambvfx:held-torch-glow
Draft

sambvfx wants to merge 2 commits into
NVIDIAGameWorks:mainfrom
sambvfx:held-torch-glow

Conversation

@sambvfx

@sambvfx sambvfx commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

A held torch whose flame had gone out still looked lit: under water, or with
Toggle Held Lights, the flame, the smoke and the hand light went out, but the
head of the torch drew as a bright white quad in an otherwise dark scene.

A held block borrows the atlas material of its placed counterpart, and a
torch's texture is emissive there. HeldLightState decides whether a held
item's lit element burns, and the flame, the smoke, the hand light and the
held beam consult it, but nothing told the material.

Change

  • ItemRendererMixin records, for the duration of one item render, whether the
    held item's lit element is out (HeldItemEffectsRenderer.isDoused, the same
    test that already suppresses the flame).
  • RemixCapturingConsumer samples that per part as each part opens, as it does
    the block-item layer, because two held items can arrive through one layer.
  • RemixEntitySubmitter sends such a part through an atlas cutout material
    whose emission is zero (EntitySurfaceMode.DOUSED). It is made on first use
    from the existing emission-scaled atlas material, shared by every doused
    part, and dropped when materials reload.

Items with no flame to put out (glowstone, a lantern) and props outside a hand
are unchanged.

Tested

  • The Fabric, Forge and NeoForge module tests pass, with new tests for the
    narrowing and for the per-part answer.
  • In game on Fabric, Windows x64, in a closed dark room with the camera held:
    the torch-head region of the final image read 0.518 (of 1) with the torch
    lit and 0.000 under water with the default rule, where it was a saturated
    white quad before. The same with a soul torch, and with Toggle Held Lights
    in air (0.005). With flames allowed under water it lights again, and after
    going out and relighting the lit image differs from the first at 0.2% of
    pixels against its own floor, so the material switches back.
  • Not tested in game: another player's held torch, third person, Forge and
    NeoForge.

🤖 Generated with Claude Code

sambvfx and others added 2 commits November 24, 2026 09:35
A held block borrows the atlas material of its placed counterpart, and a
torch's texture is emissive there. HeldLightState put out the flame, the
smoke and the hand light, but nothing told the material, so under water, or
with Toggle Held Lights, the head of the torch still drew as a bright white
quad in an otherwise dark scene.

The item renderer hook now records whether the held item's lit element is
out, the capture samples that per part as it does the block-item layer, and
the submitter sends such a part through an atlas cutout material whose
emission is zero (EntitySurfaceMode.DOUSED). That material is made on first
use from the existing emission-scaled atlas material and dropped when
materials reload. Items with no flame to put out, and props outside a hand,
are unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Sam Bourne <sbourne@nvidia.com>
Drop a duplicate assertTrue import, align dousedSurfaceMode's parameters,
and leave the doused flag to the test class's @AfterEach reset.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Sam Bourne <sbourne@nvidia.com>
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.

1 participant