Skip to content

Repository files navigation

Flashlight: Shader Light Engine

A real flashlight for Minecraft. Smooth beam, honest shadows, blinding glare.

Minecraft 26.1.x · Fabric · Java 25 · client and server · requires Fabric API

Every flashlight mod does the same trick: invisible light blocks chasing your crosshair, chunky relights, light leaking through walls. Flashlight doesn't. It ships its own shader-driven light engine — a smooth volumetric cone that updates every frame, stops at walls, casts soft shadows 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 ↔ razor-thin 110-block spot fixed ~40° 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: floodlight for corridors, sniper beam for scouting.
  • Batteries are consumables. Below 20% charge the beam visibly dies — reload or walk in the dark.

✦ 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).

✦ 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. That means:

  • 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.
  • Real shadows — the 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. Soft edges come from a rotated PCF kernel, entities cast sharp capsule silhouettes, and the beam dissolves vanilla shadow circles it hits.
  • Shadows under Sodium — Sodium renders terrain with its own programs and never fills the vanilla draw list, so shadow maps are impossible there. Instead the beam is occluded by a bit-packed half-block voxel grid (64 blocks across, ray-marched per pixel, rescanning only blocks that actually changed). Coarser than the shadow atlas and shorter-ranged — but it is real occlusion, and it costs Sodium nothing.
  • 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.
  • Sodium-ready — with Sodium installed the beam is injected straight into its terrain shaders. Same light, Sodium speed; shadows switch to the voxel path described above.

✦ Installation

  1. Install Fabric Loader for Minecraft 26.1.x.
  2. Install Fabric API.
  3. Run Java 25.
  4. Drop the jar into mods — on the client and the server (items and batteries are real).
  5. 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.

✦ Building from source

./gradlew build      # jar lands in build/libs
./gradlew runClient  # dev client

✦ License

MIT

About

A real flashlight for Minecraft — shader-driven light engine with volumetric beam, voxel shadows and blinding glare. Fabric 26.1.x, companion to Enhanced Darkness.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages