Version differences
The API (LambentClient, LightSource, LightFrame, the light records) works the same way on every
version. What differs is how Lambent hooks into each version’s renderer, and a few helpers that only
some versions have.
At a glance
| 1.20.1 | 1.21.1 | 26.1.2 | 26.2 | 26.3 | |
|---|---|---|---|---|---|
| Loader | Forge | NeoForge | NeoForge | NeoForge | NeoForge |
| Java | 17 | 21 | 25 | 25 | 25 |
| Names | SRG, with a refmap | Mojang | Mojang (the game ships unobfuscated) | Mojang | Mojang |
| Graphics | OpenGL | OpenGL | OpenGL | OpenGL only (no lights on Vulkan) | OpenGL only (no lights on Vulkan) |
| Depth | 0 near, 1 far | 0 near, 1 far | 0 near, 1 far | Reversed: 1 near, 0 far | Reversed |
LambentClient.program, texture |
Yes | Yes | No | No | No |
Every version checks for Iris (or Oculus on 1.20.1) by reflection, so a shader pack works wherever one of them is installed.
1.20.1 and 1.21.1
Lambent draws with its own GL programs, vertex arrays and buffers, and puts back the GL state
Minecraft tracks when it is done. Mods that draw after the lights with their own programs can use the
LambentClient.program and LambentClient.texture helpers (see Rendering).
The 1.20.1 jar carries a mixin refmap, since Forge 1.20.1 runs on SRG names.
Under Fabulous graphics, the extra item and translucent targets stay unbound while entities draw into the shadow maps, because binding them would move the drawing off the shadow atlas.
26.x: what changed for every 26 version
Minecraft 26 draws through its own GPU API (GpuDevice, render passes, pipelines). Lambent still
draws its lights with GL calls of its own, but:
- It sets GL state through
GlStateManagerwherever Minecraft keeps a copy of it (textures, blend, depth, cull, color mask, framebuffers), so Minecraft’s copy stays true. - Minecraft binds a sampler object to every texture unit it draws from. A sampler object overrides a texture’s own filtering, so before drawing, Lambent unbinds them from the units it uses.
- The shadow atlas is a texture made through Minecraft’s
GpuDevice, so Minecraft’s own entity and feature renderers can draw entities into it. LambentClient.programandLambentClient.textureare gone. Draw after the lights through Minecraft’s API, or with your own GL calls throughGlStateManager.
26.2
- Reversed depth. Minecraft now writes 1 at the near plane and 0 at the far plane and the sky. It
clears depth to 0 and tests greater-or-equal. Lambent still works in OpenGL’s usual convention
internally. It reads the scene’s depth as
1 - depthand turns the projection back where it draws against Minecraft’s depth buffers. Its own shadow atlas is reversed too, so Minecraft’s passes can draw entities into it. - Vulkan. Minecraft can run on Vulkan, chosen under Video Settings, Graphics API. Lambent draws with OpenGL, so on Vulkan it draws no lights and logs one warning saying why. OpenGL is still the default.
- Leftover GL state. Minecraft can leave its scissor test on, set to the window’s rectangle, and leave its pixel unpacking set from its last upload. A leftover scissor would cut every shadow map to that rectangle. So Lambent turns the scissor off and resets unpacking before it draws. Minecraft sets both again itself before it next needs them.
- Block changes are reported through
ClientLevel.sendBlockUpdated, sinceLevelRenderer.blockChangedis gone. - Under Fabulous, the main depth is cleared before the always-on-top pass. A pass of Lambent’s copies the scene’s depth back from the translucent target, so the lights still find surfaces.
26.3
- Much of Mojang’s GPU API moved packages, from
com.mojang.blaze3dtocom.mojang.renderpearl(renderpearl.apifor the API,renderpearl.backend.openglfor the GL backend). - The level is drawn from its extracted render state.
GameRenderer.renderLeveltakes no arguments, and Lambent reads the view fromCameraRenderState.viewRotationMatrixand the partial tick from the level render state. - Feature renderers draw into a render pass their caller opens. Lambent opens its own pass over the shadow atlas for the entities in each beam, with a scissor round the beam’s tile.
- Fabulous is now order-independent transparency, composited over the main target. The opaque world’s and entities’ depth stays on the main target, so the 26.2 depth copy is gone. Translucent blocks write no depth under Fabulous, so a lamp shining on water lights what is under the water, not its surface.