Lambent
Lambent is the lighting library behind my mods. It draws real light over Minecraft’s finished frame: beams with shadow maps, haze and dust in the air, point lights that stay inside the room they burn in, glare and lens bloom. Like Veil, it is a library. It lights nothing on its own; mods hand it their lights every frame.
Lambent started as Veltorque’s headlight code. Once flashlights and flares were added the lighting had grown into its own engine, so I moved it out into a mod that any of my mods can use. Veltorque’s headlights, reverse lamps, tail lamps, flashlights and flares are all Lambent lights now.
This wiki is for developers who want to light something from their own mod, or work on Lambent itself. Players only need the installation section and the settings.
What Lambent gives you
| Kind | What it is | Room per frame |
|---|---|---|
| Spot lights | A pair of beams sharing one shadow map (headlights) or a single beam (a flashlight). They light what they hit and cast real shadows from blocks and entities, show as lit haze with dust in the air, and tint through stained glass. | 4 |
| Point lights | Light all round a point (a flare). No shadow map, but blocks between the light and a surface still stop it, and it stays inside the hollow it burns in. | 6 |
| Glows | A lit lens facing a direction, with an optional streak of glare across the screen. | 48 |
| Lens bloom | A tight glow and a wide halo round a lit lamp’s box. | 16 |
All of them are drawn after the level, before the hand. Under an Iris or Oculus shader pack they are drawn over the pack’s last pass.
Supported versions
| Minecraft | Loader | Java | Notes |
|---|---|---|---|
| 1.20.1 | Forge | 17 | Raw OpenGL. The jar carries a mixin refmap (SRG names). |
| 1.21.1 | NeoForge | 21 | Raw OpenGL. |
| 26.1.2 | NeoForge | 25 | OpenGL, alongside Mojang’s GPU API. Minecraft ships unobfuscated from here on. |
| 26.2 | NeoForge | 25 | OpenGL only: no lights when Minecraft runs on Vulkan. Reversed depth. |
| 26.3 | NeoForge | 25 | OpenGL only, as 26.2. Mojang’s GPU API moved to com.mojang.renderpearl. |
The current version is 0.1.0. The API is the same on every version; the differences are listed in
Version differences.
Pages
- Getting started: installing, depending on Lambent, a first light source, building.
- Light sources:
LightSource,LightFrame, priorities, room, fading, darkness. - Lights reference:
Beam,Lamp,Point,Glow,Lens,Lights, with every field explained. - Rendering: what happens in a frame, the shadow maps, the light pass, shader packs,
AfterLights. - Settings and performance:
lambent-client.propertiesand what each setting costs. - Testing: the in-game self-test.
- Version differences: what changes between Minecraft versions.
Conventions used on every page
Camera-relative. Every position you hand Lambent is relative to the camera: world position minus
frame.eye(). frame.relative(Vec3) does the subtraction for you. It keeps the numbers small, so
lights stay steady far from the world origin.
Units. One block is one metre. Ranges and reaches are in metres, angles in radians, times in seconds.
Colors carry brightness. A light’s color is linear RGB already multiplied by how bright it is,
and by how dark it is round it if the light should fade by day. (1, 1, 1) is a bright white lamp;
values above 1 are fine.
Keys. A spot light’s key identifies it from frame to frame, so its shadow blocks and dusty air
are kept rather than rebuilt. Pick keys no other source uses: an entity id times a few plus which lamp,
or negative numbers for players.