Skip to content

Light the vanilla beacon and its beam - #66

Open
JimmyfaQwQ wants to merge 3 commits into
NVIDIAGameWorks:mainfrom
JimmyfaQwQ:vanilla-beacon-lights
Open

JimmyfaQwQ wants to merge 3 commits into
NVIDIAGameWorks:mainfrom
JimmyfaQwQ:vanilla-beacon-lights

Conversation

@JimmyfaQwQ

@JimmyfaQwQ JimmyfaQwQ commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Refs #29.

An active vanilla beacon's beam rendered as an unlit surface: its translucent glow layer was classified TRANSLUCENT and its opaque core CUTOUT, both lit by the scene. At night the beam is as bright as the sky behind it, so it is invisible.

This change classifies the beam's surfaces as emitters. It creates no light: review asked for no analytic lights, because strong cylinder lights are noisy and shimmer in unrelated areas (lanterns were rolled back from cylinder lights to emissive surfaces during development for the same reason).

Surface. RenderLayerUtils.surfaceMode passes a beaconBeamProgram flag (the layer's shader is RENDERTYPE_BEACON_BEAM_SHADER) to classifySurfaceMode. For the beam, the translucent glow layer becomes EMISSIVE (a blended emitter) and the opaque core becomes a new EntitySurfaceMode.EMISSIVE_CUTOUT in renderer-core.

Submitter. RemixEntitySubmitter treats EMISSIVE_CUTOUT as cutout for the alpha test, uses the albedo as the emissive texture as it does for EMISSIVE, and attaches no subsurface profile. A blended core would drop out wherever the beam runs through stained glass and the ray behind it reaches only sky; the alpha-tested core stays continuous through the glass, as the unlit core did before.

No light. There is no BlockLightDefaults rule, no LightManager change, and no mixin. The beacon block itself gets nothing from the mod; it glows only through whatever emission its resource pack authors. AGENTS.md gains one architecture sentence (the beam is an emissive surface, not a light) and one invariant (the vanilla beacon and its beam get no analytic light, with the shimmer reason).

The branch is up to date with current main (Mojang mappings, the versions/1.21.1/minecraft/ and renderer-core/ layout). Files touched versus main: EntitySurfaceMode.java, RemixEntitySubmitter.java, RenderLayerUtils.java, RenderLayerUtilsTest.java, AGENTS.md.

Verification

  • .\gradlew.bat test "-PmcVersion=1.21.1" "-Ploader=fabric" --rerun-tasks: 1746 tests pass, including the two beam rows in RenderLayerUtilsTest (translucent beam layer -> EMISSIVE, opaque beam layer -> EMISSIVE_CUTOUT).
  • In game (RTX 5080, low preset), captured with the mod's own still-shot capture from fixed poses: a flat smooth-stone platform with one plain beacon and one beacon whose beam passes through red then blue stained glass. Two poses: a wide view at noon from about 15 blocks away, and a far view at night from about 100 blocks. The main column is upstream main at d5f4a4b; the Vanilla column is the same build with RTX off.
Scene main This change Vanilla
Wide, noon before_beacon_wide_noon after_beacon_wide_noon before_vanilla_beacon_wide_noon
Far, night before_beacon_far_night after_beacon_far_night before_vanilla_beacon_far_night
  • Pixel measurements, mean luminance (0-255) of the brightest beam columns against the median sky column in the upper part of the frame:

    Pose main (beam / sky) This change (beam / sky) Vanilla (beam / sky)
    Far, night 83 / 82 250 / 107 107 / 12
    Wide, noon 238 / 228 253 / 229 209 / 187

    At night the beam goes from invisible (indistinguishable from the sky on main) to about 2.3 times the sky; at noon all three are within a few percent of their sky.

  • Visually: both beams glow in their segment colours, the segment above the red glass reads pink-red, and the core is continuous through the glass. The platform is no longer lit by the beam, which is expected without a light.

Pre-existing, not changed here. Viewed obliquely, a stained glass block can show sky where the stone wall behind it should be, with the same vertical gradient as the sky outside; head-on it shows the wall. This happens on main too. Stained glass is a solid refracting cube (BlockTextureManager.buildAtlasTransMaterialInfo: MaterialInfoTranslucentEXT, IOR 1.52, no thinWall). Setting thinWall(0.0625f) locally made the artifact disappear, but also left the glass almost colourless, so fixing it needs its transmittance retuned and belongs in its own change, tracked in #67.

🤖 Generated with Claude Code

An active vanilla beacon cast no light: no built-in rule covered
minecraft:beacon, and its beam rendered as an unlit surface.

The core is a new built-in beacon rule, a white sphere inside the glass
at the block's light level, with its Block Lights control. Vanilla's
beacon is light level 15 whether or not it is active, so a block rule
matches it and gets the usual terrain-light culling.

The beam is lit by LightManager, which finds client-side beacons through
LoadedVanillaBeacons, kept in step by a mixin on setWorld and
markRemoved. For each active beacon it emits one cylinder per entry of
getBeamSegments(), in that segment's colour, with a volumetric scale so
the beam reads as a shaft. The lights start at the beacon's top face
so they never overlap the core rule, stop at
VanillaBeaconBeam.MAX_LIGHT_TOP rather than the renderer's 1024 blocks,
are rebuilt only when a segment or the Beacon multiplier changes, and
like the Copper Beacon's are never culled. The Beacon row in Block
Lights scales the beam as well as the core.

The beam glows by itself. Its translucent glow layer is a blended
emitter, and its opaque core is a new EMISSIVE_CUTOUT surface mode:
still alpha-tested, with the albedo as its emissive texture. A blended
core dropped out wherever the beam runs through stained glass and the
ray behind it reaches only sky.

Refs NVIDIAGameWorks#29.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Junyu Tao <jimmyfa@jimmyfa.xyz>
@Ekozmaster

Copy link
Copy Markdown
Collaborator

Hey @JimmyfaQwQ that is pretty sick, and looks gorgeous! Thank you for that.

Unfortunately we have to be extra careful with analytical lights usage and types. Cylinder lights especially, are notorious for being noisy, and being strong like that, it has potential to create a lot of shimmer in seemingly unrelated areas (during development we had to roll back Lanterns from using cylinder lights to be just emissive surfaces).

I know this might be a bummer but, could you reimplement both the beacon beam and block as emissive surfaces only? It should still throw some decent light and look nice in primary view, only won't light up the surroundings as strongly as having an actual analytical light.

Thank you again and sorry about it.

JimmyfaQwQ and others added 2 commits November 28, 2026 13:23
Take main for the light-side files: the analytic beam lights and the
beacon rule are dropped at the maintainers' request, so only the beam
surface classification survives, moved to the versions/ layout and the
Mojang mappings.

Signed-off-by: Junyu Tao <jimmyfa@jimmyfa.xyz>
The beam gets no analytic light any more, so the architecture notes say
how it lights instead and why.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Junyu Tao <jimmyfa@jimmyfa.xyz>
@JimmyfaQwQ

Copy link
Copy Markdown
Contributor Author

Hey @JimmyfaQwQ that is pretty sick, and looks gorgeous! Thank you for that.

Unfortunately we have to be extra careful with analytical lights usage and types. Cylinder lights especially, are notorious for being noisy, and being strong like that, it has potential to create a lot of shimmer in seemingly unrelated areas (during development we had to roll back Lanterns from using cylinder lights to be just emissive surfaces).

I know this might be a bummer but, could you reimplement both the beacon beam and block as emissive surfaces only? It should still throw some decent light and look nice in primary view, only won't light up the surroundings as strongly as having an actual analytical light.

Thank you again and sorry about it.

Thanks for the detailed feedback, @Ekozmaster, and sorry for the late reply, I only saw your comment today. That makes sense, and I agree: I'll drop the analytic lights entirely, meaning both the beam cylinder lights and the beacon block light rule. The beam will stay as emissive surfaces only, with the translucent glow as EMISSIVE and the opaque core as EMISSIVE_CUTOUT. In the same update I'll also bring the branch up to current main (Mojang mappings and the versions/ layout). I'll include before/after screenshots when it's ready.

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.

2 participants