feat: layer the nightdrive sky and atmosphere

This commit is contained in:
2026-09-02 14:52:03 +03:00
parent 3c932cb840
commit 5c52de9134
15 changed files with 801 additions and 168 deletions

View File

@@ -22,6 +22,13 @@ test('keeps navigation, HUD, progress, chapter, and arrival on the same next-fra
page,
distUrl,
}) => {
const graphicsErrors: string[] = [];
page.on('console', (message) => {
if (
message.type() === 'error'
&& /THREE\.WebGLProgram|Shader Error|VALIDATE_STATUS/iu.test(message.text())
) graphicsErrors.push(message.text());
});
await page.goto(distUrl, { waitUntil: 'domcontentloaded' });
await expect(page.locator('.journey-world')).toHaveAttribute('data-scene-state', /running|failed|static/u);
const chapterColors: string[] = [];
@@ -60,16 +67,13 @@ test('keeps navigation, HUD, progress, chapter, and arrival on the same next-fra
const instrumentation = await readSceneInstrumentation(page);
expect(instrumentation.maximumCanvasCount).toBeLessThanOrEqual(1);
const expectedChapterColors = (page.viewportSize()?.width ?? 0) < 768
? [
'#040713', '#040713', '#060918', '#080b1d',
'#0d1025', '#0d1025', '#18152c', '#2b2035',
]
: [
'#000102', '#000102', '#000102', '#010103',
'#010105', '#010105', '#020206', '#060409',
];
expect(chapterColors).toEqual(expectedChapterColors);
const chapterEnergy = chapterColors.map(colorEnergy);
for (let index = 1; index < chapterEnergy.length; index += 1) {
expect(chapterEnergy[index]).toBeGreaterThanOrEqual(chapterEnergy[index - 1] ?? 0);
}
expect(chapterEnergy.at(-1)).toBeGreaterThan(chapterEnergy[0] ?? 0);
expect(new Set(chapterColors).size).toBeGreaterThanOrEqual(4);
expect(graphicsErrors).toEqual([]);
});
test('draws only the independently eligible next roadside sign during passive forward travel', async ({
@@ -99,3 +103,8 @@ test('draws only the independently eligible next roadside sign during passive fo
const labels = (await readSceneInstrumentation(page)).routeLabelsDrawn;
expect([...new Set(labels)]).toEqual([oracle.expectedLabel]);
});
function colorEnergy(color: string): number {
const value = Number.parseInt(color.slice(1), 16);
return ((value >> 16) & 0xff) + ((value >> 8) & 0xff) + (value & 0xff);
}