mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
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.
This commit is contained in:
1 parent
1b226e14f2
commit
5cd28731fa
3 files changed
+22
-6
No files matched your search
@@ -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.
|
||||
|
||||
|
||||
@@ -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',
|
||||
|
||||
Vendored
+3
-1
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user