适用于 Minecraft 的真实手电筒。平滑的光束、真实的阴影以及刺眼的眩光。
大多数手电筒模组都采用同样的技巧:追踪你准星的隐形光源方块、粗糙的重新光照,以及光线穿透墙壁的漏洞。Flashlight: Shader Light Engine 并非如此。光束是在游戏自身的着色器中计算的——一个每帧更新的平滑锥形,会在墙壁处停止,从真实的方块形状投射出真正的阴影,并且会让直视镜头的人目眩。它作为 Enhanced Darkness 的配套模组构建:在它的漆黑世界中,你需要用到它。
两种灯光,两种用途
|
Flashlight |
Work Lantern |
| 角色 |
廉价的全能选手 |
昂贵的泛光灯 |
| 光束 |
滚动以聚焦镜头:宽 25 格泛光至锋利精准的 110 格定点 |
固定的光墙,55 格 |
| 电源 |
AA 电池 — 30 分钟 |
电池组 — 45 分钟 |
| 合成 |
铁 + 红石 + 玻璃 |
金、铁、红石块 |
| 战利品 |
村庄(+ AA 电池) |
地牢、矿井、要塞(+ 电池组) |
- 右键 — 开关。R — 插入新电池,带有枪栓上膛般的动画和抽屉拉出的音效。
- 鼠标滚轮(手电筒开启,任意手持状态) — 变焦镜头。每次滚轮点击都会按相同比例改变宽度,使整个变焦过程都有用。
- 电池是一次性消耗品。电量低于 20% 时,光束会明显变弱——要么更换电池,要么摸黑前行。
光束形状如同真实之光
不是扁平的光盘。来自反射器的明亮热点位于由镜圈界定的宽阔、微弱的晕圈内部——这正是真实火炬投射在墙上的效果。
放大时,热点变窄并从晕圈中“窃取”光线,因为这就是变焦镜头的物理特性;晕圈的宽度几乎不变,因为它的宽度由镜圈决定,而非镜头。在全焦状态下,中心极其强烈并在几度内坍缩,然后是一条长长的微弱光带延伸至边缘。在最小焦距下,形状与工作灯笼匹配。
亮度随距离呈平方反比衰减,模拟了位于反射器后方的虚拟光源——因此光线在整个光束路径上平滑减弱,而不是保持恒定然后突然切断。
真实的阴影
地形从手电筒的视角被重新渲染到深度图集(depth atlas)中,因此阴影遵循实际几何结构:台阶投射台阶的阴影,楼梯投射楼梯的阴影,树叶投射斑驳的阴影。范围可达 64 格。柔和的边缘来自于旋转的模糊核——如果核与纹理轴对齐,由于 Minecraft 的墙壁也是轴对齐的,读出来会是阶梯状。实体投射出锐利的胶囊状剪影,而光束会溶解它所击中的原版阴影圆圈。
安装了 Sodium 时,无法使用阴影贴图。 Sodium 使用自己的程序渲染地形,从不填充原版的绘制列表,因此没有东西可以从光的视角进行重新渲染。相反,光束通过一个位打包的半方块体素网格被遮挡,横跨 64 格,逐像素光线步进。这比阴影图集更粗糙且射程更短——但这是真实的遮挡计算,而且不消耗 Sodium 的任何性能。
夜间行动
- 夜视仪 — 佩戴在头部,按 G 切换。真正的图像增强管:~3 秒预热,同步于开机声音,画面会 visibly 碎裂成像素。边缘锐化在每个剪影周围绘制恰好一个管单元宽度的硬边框,因此当你戴上它们时,低分辨率显而易见——不需要眯眼去辨认。还有扫描线、随着电池耗尽而加粗的传感器噪点、热点周围的光晕,以及真实的过曝:日光、火把或手电筒光束会使像素燃烧成苍绿色。使用 AA 电池运行 30 分钟,可通过同一按键热交换更换。仅限合成——无战利品掉落。
- 信号弹 — 按住右键蓄力,松开以抛物线投掷(约 35 格)。落地后燃烧 60 秒,发出来自同一引擎的闪烁红色点光源,并伴随一股红色烟柱。一次性使用,不可熄灭。
- 音效 — 手电筒咔哒声、镜头变焦声、夜视仪开/关的嗡嗡声、工作灯笼运行的低沉轰鸣声。支持字幕(英/俄)。
设置
ModMenu → 齿轮图标,或 config/flashlight.json。三个标签页——阴影、光束、夜视——每个滑块在你拖动时即时生效,因此你可以站在光中调整光线。阴影分辨率是唯一例外:它大小取决于 GPU 纹理,因此需要在下次加入世界时生效。
引擎原理
没有光源方块。没有区块重光照。锥形光束是在游戏核心着色器内部计算的——地形、实体、掉落物、粒子甚至原版生物的阴影团块都会在运行时克隆,并注入光束数学逻辑。
- 即时 — 你移动的那一帧,光就移动,带有类似真实火炬的微小手部滞后惯性。
- 真实 — 光照 =
反照率 × 锥形:真实的纹理,真实的颜色,零噪点,在绝对黑暗中也能工作。
- 原生多人游戏 — 同时最多 128 个光源,无每区块上限:你可以在一处堆叠任意多的信号弹,它们都会发光。每个人都能看到其他人的光,包括变焦级别。
- 致盲 — 眩光是物理现象,而非精灵图:其强度等于在你眼睛位置的实际锥形强度,经过方块和生物追踪。近距离直视镜头会导致屏幕白屏。
安装
- 为 Minecraft 26.1.x 安装 Fabric Loader。
- 安装 Fabric API。
- 运行 Java 25。
- 将 jar 文件放入
mods 文件夹——客户端和服务器端都需要(物品和电池是真实的)。
- 与 Enhanced Darkness 搭配效果最佳。
Iris 光影包会完全替换游戏的着色器——启用光影包后,光束将无法照亮地形。仅安装 Sodium 即可开箱即用。
许可证
MIT —— 源代码位于 GitHub。
A real flashlight for Minecraft. Smooth beam, honest shadows, blinding glare.
Every flashlight mod does the same trick: invisible light blocks chasing your crosshair, chunky relights, light leaking through walls. Flashlight: Shader Light Engine doesn't. The beam is computed inside the game's own shaders — a smooth cone that updates every frame, stops at walls, casts real shadows from real block shapes, and blinds anyone who looks into the lens. Built as the companion to Enhanced Darkness: in its pitch black you'll need one.
Two lights, two jobs
|
Flashlight |
Work Lantern |
| Role |
cheap all-rounder |
expensive floodlight |
| Beam |
scroll to focus the lens: wide 25-block flood to a razor-thin 110-block spot |
fixed wall of light, 55 blocks |
| Power |
AA battery — 30 min |
battery pack — 45 min |
| Recipe |
iron + redstone + glass |
gold, iron, redstone block |
| Loot |
villages (+ AA batteries) |
dungeons, mineshafts, strongholds (+ battery packs) |
- Right-click — on/off. R — slam a fresh battery in, gun-reload style, with a chest-pull animation.
- Mouse wheel (flashlight on, either hand) — zoom the lens. Every click of the wheel changes the width by the same factor, so the whole travel is useful.
- Batteries are consumables. Below 20% charge the beam visibly dies — reload or walk in the dark.
The beam is shaped like a real one
Not a flat disc of light. A bright hotspot from the reflector sits inside a wide, faint corona bounded by the bezel — exactly what a real torch throws on a wall.
Zooming in narrows the hotspot and steals light from the corona, because that is what a zoom head physically does; the corona barely changes width, because its width is set by the bezel, not the lens. At full zoom the centre is intense and collapses within a few degrees, then a long shelf of faint light runs out to the edge. At minimum zoom the shape matches the work lantern.
Brightness falls off with distance as inverse-square, modelling a virtual source behind the reflector — so the light fades smoothly along the whole beam instead of holding up and then cutting off.
Real shadows
Terrain is re-rendered from the flashlight's point of view into a depth atlas, so shadows follow the actual geometry: a slab casts a slab, stairs cast stairs, leaves cast a dappled mess. Reaches 64 blocks. Soft edges come from a rotated blur kernel — a kernel aligned to the texture axes would read as a staircase, because Minecraft walls are axis-aligned too. Entities cast sharp capsule silhouettes, and the beam dissolves the vanilla shadow circles it hits.
With Sodium installed, shadow maps are not possible. Sodium renders terrain with its own programs and never fills the vanilla draw list, so there is nothing to re-render from the light's point of view. Instead the beam is occluded by a bit-packed half-block voxel grid, 64 blocks across, ray-marched per pixel. Coarser and shorter-ranged than the shadow atlas — but it is real occlusion, and it costs Sodium nothing.
Night ops
- Night Vision Goggles — worn on the head, toggled with G. A real image-intensifier tube: ~3 s warm-up synced to the power-on sound, and a picture that visibly breaks into pixels. Edge sharpening draws a hard rim exactly one tube-cell wide around every silhouette, so the low resolution is obvious the moment you put them on — not something you have to squint for. Plus scanlines, sensor grain that thickens as the battery dies, bloom around hot spots, and honest overexposure: daylight, torches or a flashlight beam burn out to pale green per-pixel. Runs 30 min on an AA battery, hot-swapped with the same key. Craft-only — no loot.
- Signal Flare — hold right-click to wind up, release to throw in an arc (~35 blocks). Lands, burns for 60 s with a flickering red point light from the same engine and a column of red smoke. Single-use, can't be extinguished.
- Sounds — flashlight click, lens zoom, NVG on/off whine, the low hum of a running work lantern. Subtitled (en/ru).
Settings
ModMenu → gear, or config/flashlight.json. Three tabs — Shadows, Beam, Night vision — and every slider applies while you drag it, so you can tune the light while standing in it. Shadow resolution is the one exception: it sizes a GPU texture, so it takes effect on the next world join.
The engine
No light blocks. No chunk relights. The cone is computed inside the game's core shaders — terrain, entities, dropped items, particles and even vanilla mob shadow blobs are cloned on the fly with the beam math injected.
- Instant — the light moves the frame you move, with a subtle hand-lag inertia like a real torch.
- Honest — light is
albedo × cone: real textures, real colours, zero noise, works in absolute darkness.
- Multiplayer-native — up to 128 sources at once, with no per-chunk cap: pile as many flares in one spot as you like and they all light. Everyone sees everyone's light, zoom level included.
- Blinding — glare is physics, not a sprite: its strength equals the actual cone intensity at your eyes, traced past blocks and mobs. Look into a lens up close and the screen whites out.
Installation
- Install Fabric Loader for Minecraft 26.1.x.
- Install Fabric API.
- Run Java 25.
- Drop the jar into
mods — on the client and the server (items and batteries are real).
- Pairs best with Enhanced Darkness.
Iris shaderpacks replace the game's shaders entirely — with a pack enabled the beam won't light terrain. Sodium alone works out of the box.
License
MIT — source on GitHub.
评论 0
登录后参与评分
还没有评论,来抢沙发吧