HD lighting: G-buffer pass, per-pixel mod point lights in HDR, bloom and tone curve; render.set-lights and render.set-lighting (API level 10)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 13:18:43 +03:00
committed by airdef
parent 4ae19d7dfc
commit fff9f9a746
9 changed files with 845 additions and 7 deletions
+28
View File
@@ -534,6 +534,34 @@ interface render {
/// Replaces the mod's cameras: up to 8. A `view` shape shows one; the
/// game renders up to three a frame, in turn.
set-views: func(views: list<camera-view>);
/// A light the mod's things give off (AirDef fork): rocket flames,
/// flares, blasts. Drawn by the HD lighting (`set-lighting`).
record point-light {
/// Stays the same while the light lives: the game moves it smoothly.
id: u32,
x: f64,
y: f64,
z: f64,
/// Linear RGB, 0 to 1.
color: tuple<f32, f32, f32>,
/// Brightness: about what it lights one block away (0 to 100000).
intensity: f32,
/// Nothing past this many blocks (1 to 256).
radius: f32,
}
/// Replaces the mod's lights: up to 512, interpolated per id between
/// the last two calls.
set-lights: func(lights: list<point-light>);
/// The HD lighting (AirDef fork): the world lit per pixel by the mods'
/// lights, in high dynamic range, with bloom and tone mapping.
record lighting {
hd: bool,
/// 1 as is; more brightens.
exposure: f32,
/// How much bright things glow (0 none, 1 strong).
bloom: f32,
}
set-lighting: func(lighting: lighting);
}
/// What the game calls. Only the hooks `init` asks for are ever called.