Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Merge remote-tracking branch 'origin/main' into fix/reference-one-sun

Nguyen Xuan An1568d48062a2
diff --cc bench/reference/run.mjs
index 0fea00a0,295645f0..ef4a7f55
--- a/bench/reference/run.mjs
+++ b/bench/reference/run.mjs
@@@ -69,11 -69,11 +73,12 @@@ async function renderBackend(backend, s
const sceneIds = await page.evaluate(() => window.referenceSceneIds);
for (const id of sceneIds) {
if (onlyScene && id !== onlyScene) continue;
+ await openHarness();
const started = performance.now();
const describe = backend === 'gpu';
+ const probes = probesFlag >= 0 && (probedSceneIds === null || probedSceneIds.includes(id));
const bake = bakeFlag >= 0 && (bakedSceneIds === null || bakedSceneIds.includes(id)) ? {} : null;
- const result = await page.evaluate(([sceneId, shouldDescribe, ambientOcclusion, ambientOcclusionRadius, bakeOptions, cascadeCount]) => window.renderReferenceScene(sceneId, { describe: shouldDescribe, ambientOcclusion, ambientOcclusionRadius, bake: bakeOptions, cascades: cascadeCount }), [id, describe, ambientOcclusion, ambientOcclusionRadius, bake, cascades]);
+ const result = await page.evaluate(([sceneId, shouldDescribe, ambientOcclusion, ambientOcclusionRadius, bakeOptions, cascadeCount, withProbes]) => window.renderReferenceScene(sceneId, { describe: shouldDescribe, ambientOcclusion, ambientOcclusionRadius, bake: bakeOptions, cascades: cascadeCount, probes: withProbes }), [id, describe, ambientOcclusion, ambientOcclusionRadius, bake, cascades, probes]);
if (result.glError !== 0) throw new Error(`${id} on ${backend} gave WebGL error ${result.glError}.`);
graphics[backend] = result.graphics;
await writeFile(`${WORK_DIRECTORY}/${id}-${backend}.png`, Buffer.from(result.image, 'base64'));
diff --cc tests/reference-baseline.test.js
index 2269221c,0e58e57e..a6ec54cb
--- a/tests/reference-baseline.test.js
+++ b/tests/reference-baseline.test.js
@@@ -4,7 -4,7 +4,7 @@@ import test from 'node:test'
const REFERENCE_DIRECTORY = new URL('../bench/reference/', import.meta.url);
const baseline = JSON.parse(readFileSync(new URL('baseline.json', REFERENCE_DIRECTORY), 'utf8'));
- const EXPECTED_SCENES = ['brick-flat', 'brick-graph', 'brick-room', 'brushed-film', 'car-paint', 'character', 'fog', 'foliage', 'glass', 'light-linking', 'lit-interior', 'long-street', 'material-spheres', 'megacity-dusk', 'metal', 'mountain-valley', 'outdoor-hdri', 'spot-area', 'temple-hall'];
-const EXPECTED_SCENES = ['brick-flat', 'brick-graph', 'brick-room', 'brushed-film', 'car-paint', 'character', 'fog', 'foliage', 'glass', 'light-linking', 'lit-interior', 'long-street', 'material-spheres', 'metal', 'metal-room', 'outdoor-hdri', 'spot-area'];
++const EXPECTED_SCENES = ['brick-flat', 'brick-graph', 'brick-room', 'brushed-film', 'car-paint', 'character', 'fog', 'foliage', 'glass', 'light-linking', 'lit-interior', 'long-street', 'material-spheres', 'megacity-dusk', 'metal', 'metal-room', 'mountain-valley', 'outdoor-hdri', 'spot-area', 'temple-hall'];
const EXPECTED_SCORES = ['cpu-vs-cycles', 'cpu-vs-eevee', 'eevee-vs-cycles', 'gpu-vs-cpu', 'gpu-vs-cycles', 'gpu-vs-eevee'];
test('the render baseline scores every scene with every renderer pair', () => {