From 5cd28731faf984c0742ce268830110aae82b65a9 Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Fri, 13 Nov 2026 16:31:49 -0800 Subject: [PATCH] Renderer conformance: checks that read an exact colour set a bare sky With atmosphere, fog and lighting off and clear weather a renderer applies none of its look, so draw.models.tint, draw.models.blend, globe.base.vector and globe.imagery.video set that sky first and test what they draw, not a renderer's sky light or tone mapping. --- docs/RENDERER-CONTRACT.md | 5 ++++- src/render/conformance/checks/ports.js | 19 +++++++++++++++---- src/render/contract/globe.d.ts | 4 +++- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/docs/RENDERER-CONTRACT.md b/docs/RENDERER-CONTRACT.md index 972ccea56..227473ecc 100644 --- a/docs/RENDERER-CONTRACT.md +++ b/docs/RENDERER-CONTRACT.md @@ -155,7 +155,10 @@ the sun lights it. The checks `globe.weather`, `globe.weather.drawn` and How the sky, atmosphere, haze, lighting and the frame's tone mapping and exposure look is the renderer's own: `globe.sky` switches parts on and -off, and no check compares colours. The +off, and no check compares colours. With +`atmosphere`, `fog` and `lighting` off and clear weather a renderer applies +none of its look, so the checks that read an exact colour (`bareSky` in +`checks/ports.js`) set that sky first. The reference images under `src/render/conformance/goldens/visual/` are the default renderer's own, for checking it against itself. diff --git a/src/render/conformance/checks/ports.js b/src/render/conformance/checks/ports.js index 7e5935981..0ada84320 100644 --- a/src/render/conformance/checks/ports.js +++ b/src/render/conformance/checks/ports.js @@ -138,6 +138,16 @@ async function listenerRules(r, where, subscribe, fire) { } /** A check over a fresh renderer, destroyed afterwards. */ +/** + * The sky with the renderer's look off (`SkySettings`): what is drawn shows + * its own colours, for the checks that read an exact colour. + */ +const BARE_SKY = Object.freeze({ + atmosphere: false, + fog: false, + lighting: false, +}); + function check(id, title, run, extra = {}) { return { id, @@ -151,6 +161,7 @@ function check(id, title, run, extra = {}) { for (const capability of [extra.capability ?? []].flat()) if (!r.capabilities.has(capability)) return { skip: `no ${capability}` }; + if (extra.bareSky) r.globe.sky.set(BARE_SKY); return await run(h, r); } finally { r.destroy(); @@ -3439,7 +3450,7 @@ export function portChecks() { deepEqual(ready, ['m'], 'restyled without loading again'); set.dispose(); }, - { capability: 'models' }, + { capability: 'models', bareSky: true }, ), check( 'draw.models.blend', @@ -3523,7 +3534,7 @@ export function portChecks() { under.dispose(); } }, - { capability: 'models' }, + { capability: 'models', bareSky: true }, ), check( 'draw.models.bytes', @@ -4383,7 +4394,7 @@ export function portChecks() { ); } }, - { capability: 'vectorBase' }, + { capability: 'vectorBase', bareSky: true }, ), check( 'globe.imagery.frames', @@ -4576,7 +4587,7 @@ export function portChecks() { URL.revokeObjectURL(url); } }, - { capability: 'imageryFrames' }, + { capability: 'imageryFrames', bareSky: true }, ), check( 'globe.withoutImageHooks', diff --git a/src/render/contract/globe.d.ts b/src/render/contract/globe.d.ts index adacf2ea6..e8e5635ea 100644 --- a/src/render/contract/globe.d.ts +++ b/src/render/contract/globe.d.ts @@ -203,7 +203,9 @@ export interface BaseStatus { * looks. How the sky, the atmosphere over the ground, distance haze, the * lighting and the tone mapping and exposure of the frame look is each * renderer's own, and no check compares colours with - * each other. Where the renderer's sun, moon or fog are not separate from its + * another's. With `atmosphere`, `fog` and `lighting` off and clear weather, + * a renderer applies none of its look: what is drawn shows its own colours. + * A renderer whose sun, moon or fog are not separate from its * atmosphere follows `atmosphere` for them and reports them as it draws them. */ export interface SkySettings {