feat: charge terrain with acceleration and compact desktop sign staging

This commit is contained in:
2026-09-05 14:09:26 +03:00
parent 5d5935a1f8
commit ef51580cf9
6 changed files with 96 additions and 14 deletions

View File

@@ -164,6 +164,8 @@ export async function createProceduralSceneGeneration(
let atmosphericTime = 0;
let signCameraWeight = 0;
let overdrive = 0;
let terrainSurge = 0;
let terrainSpectrumPhase = 0;
let firstFrameSuppressionRecorded = false;
const resize = (): void => {
@@ -257,6 +259,19 @@ export async function createProceduralSceneGeneration(
(chargeTarget - overdrive) *
(1 -
Math.exp(-deltaSeconds / (chargeTarget > overdrive ? 0.28 : 1.05)));
// Terrain feedback reads acceleration directly, with its own fast attack
// and long release. Audio and the shared drive responses stay untouched.
const surgeTarget = Math.sqrt(
THREE.MathUtils.clamp(snapshot.acceleration, 0, 1),
);
terrainSurge +=
(surgeTarget - terrainSurge) *
(1 -
Math.exp(-deltaSeconds / (surgeTarget > terrainSurge ? 0.11 : 1.15)));
// Integrate color travel instead of multiplying elapsed time by speed:
// lifting off slows the spectrum to rest without rewinding its phase.
terrainSpectrumPhase =
(terrainSpectrumPhase + deltaSeconds * overdrive * 0.38) % 1;
writeChapterPalette(targetPalette, snapshot.chapter, snapshot.chapter, 0);
dampPalette(currentPalette, targetPalette, deltaSeconds);
const driveDistance = travelDistance.advance(
@@ -289,6 +304,8 @@ export async function createProceduralSceneGeneration(
snapshot.routeProgress,
currentPalette,
overdrive,
terrainSurge,
terrainSpectrumPhase,
);
atmosphericTime += deltaSeconds;
const elapsedSeconds = atmosphericTime;