Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

test(modeling): the report's decimate warning is proven with a coarser stain - a pattern of 0.12 split the rock into a quarter of a million triangles twice, thirteen seconds on a desktop and fifty on a runner, and the warning reads the same at 0.5 in under two

yhhd29084a1484c
diff --git a/pipeline/tests/modeling-report.test.ts b/pipeline/tests/modeling-report.test.ts
index b1cd28f2c..abd5fe599 100644
--- a/pipeline/tests/modeling-report.test.ts
+++ b/pipeline/tests/modeling-report.test.ts
@@ -56,7 +56,7 @@ describe('a model report\'s steps', () => {
] as ModelSource['steps'] }).report.warnings;
// A stain by a pattern is as fine as its pattern: it splits the faces the decimate kept.
- const said = rock([{ id: 'lichen', op: 'stain', faces: 'rock', color: [0.3, 0.4, 0.2], pattern: 'bumps', scale: 0.12 }]);
+ const said = rock([{ id: 'lichen', op: 'stain', faces: 'rock', color: [0.3, 0.4, 0.2], pattern: 'bumps', scale: 0.5 }]);
const warning = said.find((w) => w.includes('lichen'));
expect(warning).toBeDefined();
expect(warning).toMatch(/split the \d+ triangles it was given into \d+/);
@@ -69,7 +69,7 @@ describe('a model report\'s steps', () => {
// And a pattern before the decimate takes nothing back.
const before = bakeModel({ version: 1, steps: [
{ id: 'body', op: 'sphere', radius: 1, rings: 16, sides: 24, tag: 'rock' },
- { id: 'lichen', op: 'stain', faces: 'rock', color: [0.3, 0.4, 0.2], pattern: 'bumps', scale: 0.12 },
+ { id: 'lichen', op: 'stain', faces: 'rock', color: [0.3, 0.4, 0.2], pattern: 'bumps', scale: 0.5 },
{ id: 'thin', op: 'decimate', triangles: 200 },
] });
expect(before.report.warnings.some((w) => w.includes('split'))).toBe(false);