Skip to content

BSL-style voxel lighting - #99

Open
CanReader wants to merge 18 commits into
Advanced-Shadersfrom
feat/voxel-lighting
Open

CanReader wants to merge 18 commits into
Advanced-Shadersfrom
feat/voxel-lighting

Conversation

@CanReader

@CanReader CanReader commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

BSL-style lighting for the voxel world, on top of the engine's output transform and blend bloom (SleakEngine#234).

  • The atlas is sampled as sRGB, so lighting runs on linear albedo. Grass and leaf tiles are graded toward the vanilla plains colors when the atlas is built.
  • The voxel GBuffer stem writes emission, block light and sky light channels. The lighting stem composes sun and ambient the way BSL does: shadow and N·L blend between the two, per-face shading, squared AO, a minimum light and night desaturation. The palette lives in the game frame block.
  • Soft output curve, blend bloom and SSAO are on. The sun sits at 50 degrees at noon, and the sun and ambient sliders scale the palette.
  • Water keeps its look under the new transform. Block break and place effects use shared voxel meshes, so they are lit like the terrain and allocate nothing per frame.

Look against the BSL references (luma / saturation): lit grass 155.8 / 0.36 against 158.9 / 0.36, grass in tree shadow 68.4 / 0.43 against 66.5 / 0.35. OpenGL lands within a few luma points of Vulkan.

GPU time, headless at 1920x1080 and rd 16 (the headless clock runs about 3.3x slower than on screen):

Pass Before After
SSAO off 3.64 ms
Bloom off 0.51 ms
Composite - +0.15 ms
Lighting - +0.03 ms
Frame 10.95 ms 15.29 ms

Checks: Vulkan --validate --syncval clean, including a 100x100 window and back-to-back block edits; OpenGL frame time within 1% of before at a fixed pose; scripted gameplay pass on both backends.

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.

1 participant