The ambient light follows the sky by default

VICTORY_AMBIENT_SKY=off keeps the constant.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
beloooo
2026-11-25 15:56:22 -05:00
parent b76a71bbe5
commit 4f62c2a5e2
2 changed files with 11 additions and 15 deletions

View File

@ -43,9 +43,9 @@ Picture:
reaches creases, corners and the underside of things, worked out from the
scene's depth alone (`VICTORY_AMBIENT_SHADE=strength,radius`; grainy, it is
not blurred yet). In diagnostics builds all of it can be tuned in a running
game from a file (`VICTORY_AMBIENT_FILE`). It can follow the sky dome the
game draws for its reflections (`VICTORY_AMBIENT_SKY=gain,least,power`, or
a file of three or seven numbers): its level is `gain * mean^power +
game from a file (`VICTORY_AMBIENT_FILE`). It follows the sky dome the
game draws for its reflections (`VICTORY_AMBIENT_SKY=off` keeps the
constant, `gain,least,power` sets it): its level is `gain * mean^power +
least` with the sky's hue, so night, dawn and noon need no hand-set level.
- Translated shaders get clean-up passes before they are written (dead
code, constants, one instruction for one value, branch facts, one read
@ -151,8 +151,8 @@ The first launch after a build translates every shader and builds about
drive (the title's own 7 GB, 8 GB of textures on the card, copies of its
buffers, and the system's backing of video memory).
- No ray-traced light; what stands in for it is the same everywhere in a
frame. Without the sky following (off unless asked for, see above) the
default constant of 0.6 is too much at night and too little at noon.
frame. With the sky following turned off the constant of 0.6 is too much at
night and too little at noon.
- Streamed textures are capped at 1024 pixels a side (512, then 256, as
video memory fills): at 2048 this 16 GB card goes 1 to 2 GB over its
budget (`VICTORY_TEXTURE_MAX=2048` to try).

View File

@ -146,9 +146,9 @@ pub(crate) fn sky_drawn(image: usize) {
/// right were 0.07 at night, 0.3 at dusk and 1.4 at noon (runs lum1, pr1,
/// av1, 2026-11-25), with sky means of 0.001 at night and 0.65 at dawn; one
/// level for all hours either drowned the title's own shadows or left what
/// the sun does not reach black. `VICTORY_AMBIENT_SKY=gain,least` turns it
/// on (unfinished: see [`follow`]); a file of two numbers, or six with the
/// shading's, does so in a running game.
/// the sun does not reach black. On by default; `VICTORY_AMBIENT_SKY=off`
/// keeps the constant, `gain,least,power` sets it; a file of two or three
/// numbers, or six or seven with the shading's, does so in a running game.
/// shortcut: the sky's mean stands in for the light the title's traced
/// probes would gather; indoors it is the sky's too.
static FOLLOW: std::sync::Mutex<Option<Option<[f32; 3]>>> = std::sync::Mutex::new(None);
@ -163,13 +163,9 @@ fn follow() -> Option<[f32; 3]> {
}
static SET: OnceLock<Option<[f32; 3]>> = OnceLock::new();
*SET.get_or_init(|| {
// Off unless asked for: it does not work yet. The image the sky
// program draws into is not the one expected here, and the sky is in
// the scene's units while the light is exposed already, so the
// title's exposure is needed too.
let Ok(set) = std::env::var("VICTORY_AMBIENT_SKY") else {
return None;
};
// On unless `off`: by day and by night it looked right where a
// constant did not (runs ciel3, opt1b, 2026-11-25).
let set = std::env::var("VICTORY_AMBIENT_SKY").unwrap_or_default();
if set.trim() == "off" {
return None;
}