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.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
feat(render): the medium quality level smooths edges temporally by default
yhh58afdde32023
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex a438362a5..5b36731e5 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -16,7 +16,7 @@ published separately; it ships inside the editor.### Added-- **A quality level can smooth edges temporally.** `QualityProfile.antialiasing` is `'msaa'` (what every level does today) or `'temporal'`: that level draws at one sample, adds the `taa` pass to the camera's post-process volume whether or not the scene lists it, leaves `fxaa` out, and runs `taa` even where the level skips it. On the terrain-water example at 1080p it is 12.9 ms against 15.4 ms for 4 samples and FXAA, and 12.6 ms against 13.5 ms for the medium level's 2 samples; the pass itself is 0.18 ms. The picture is softer, a cut-out leaf has no coverage dither, and water, which has no motion vector, smears a little when the camera moves fast, so no level uses it by default.+- **A quality level can smooth edges temporally.** `QualityProfile.antialiasing` is `'msaa'` (what every level does today) or `'temporal'`: that level draws at one sample, adds the `taa` pass to the camera's post-process volume whether or not the scene lists it, leaves `fxaa` out, and runs `taa` even where the level skips it. On the terrain-water example at 1080p it is 12.9 ms against 15.4 ms for 4 samples and FXAA, and 12.6 ms against 13.5 ms for the medium level's 2 samples; the pass itself is 0.18 ms. The picture is softer, a cut-out leaf has no coverage dither, and water, which has no motion vector, smears a little when the camera moves fast. The medium level uses it; set `antialiasing: 'msaa'` in its profile to keep the 2 samples.- **An Offset side the layout drops is dimmed, with the reason in its tooltip.** In the inspector, a UI node whose Offset has both a start side and a size set already has this axis fixed, so the far side does nothing; that field is dimmed, and its tooltip says which two settings decide the axis and that setting one of them to auto brings the side back.- **Every render-graph pass has its own GPU time in the profiler, and the scene pass can be split by shader.** The profiler reads a GPU time for each pass of the frame on WebGL2 and WebGPU, not one number for the frame. With the profiler on and `module.esGpuDetail` set, each run of draws that use one shader is its own timed segment of the scene pass (WebGL2). `docs/TERRAIN_WATER_GPU_COST.md` says what each part of the Terrain & Water example costs and why.- **Optional tools a project switches on, fetched and checked by the engine.** A project names a tool in `project.esproject` (`tools.luban.enabled`); until it does, the engine does not look for it, mention it or download it. Luban, the industry's configuration tool, turns the Excel tables a game's designers keep into JSON and the TypeScript that reads it, with references between tables checked (a site that produces an item that does not exist fails with the table, the record and the field). It is a .NET program, so the engine also fetches the .NET runtime it runs on. When either is missing, `estella tools install luban` shows exactly what it would download (name, version, licence, size, and where from) and asks before it does; `--yes` agrees in advance for CI. Each tool is pinned in `external-tools.manifest.json` to one vendor file, and a release publishes those files, repackaged as `.zip`, beside an index naming each one's size and SHA-256 and the vendor file it was made from: the engine takes them from the release mirror first and the release itself second, refuses a file that does not match, and refuses an index built from a different vendor file than it pins, so an engine version always runs the tool versions it was built against. There is no fallback to the vendor's own site. `estella luban gen` writes the tables (only the files that changed, and it removes what a deleted table used to produce), `estella luban check` fails when they are out of date, and an export of a project that has Luban on rebuilds them first. Windows, macOS (both architectures) and Linux (both architectures).diff --git a/sdk/src/render/quality.ts b/sdk/src/render/quality.tsindex 95ec0a1b1..30274c8d8 100644--- a/sdk/src/render/quality.ts+++ b/sdk/src/render/quality.ts@@ -117,7 +117,7 @@ const PROFILES: Record<QualityLevel, QualityProfile> = {skipEffects: ['ssr', 'taa', 'depthOfField', 'lightShafts', 'motionBlur', 'lensFlare', 'gtao', 'subsurface', 'voxelGI'],},medium: {- renderScale: 1, minRenderScale: 0.65, msaaSamples: 2, antialiasing: 'msaa',+ renderScale: 1, minRenderScale: 0.65, msaaSamples: 2, antialiasing: 'temporal',shadowAtlasSize: 2048, shadowCellSize: 512, shadowCascades: 3,planarReflectionScale: 0.5, planarReflectionMaxSize: 1024, planarReflectionUpdatesPerSecond: 0, depthPrepass: true,shadowDistance: 0, detailScale: 0.8, particleLimit: 5000, postProcess: true, ssao: true,diff --git a/sdk/tests/quality.test.ts b/sdk/tests/quality.test.tsindex 2a58e741b..24a435a97 100644--- a/sdk/tests/quality.test.ts+++ b/sdk/tests/quality.test.ts@@ -152,8 +152,9 @@ describe('temporal anti-aliasing as the smoothing of a level', () => {mode: level, profiles: { [level]: { antialiasing: 'temporal' } },}).profile;- it('is off in every level until a project asks, and parses only the two names', () => {- for (const level of ['low', 'medium', 'high'] as const) {+ it('is the smoothing of medium and a choice elsewhere, and parses only the two names', () => {+ expect(new QualityController({ mode: 'medium' }).profile.antialiasing).toBe('temporal');+ for (const level of ['low', 'high'] as const) {expect(new QualityController({ mode: level }).profile.antialiasing, level).toBe('msaa');}const odd = new QualityController({ mode: 'high', profiles: { high: { antialiasing: 'fxaa' as never } } }).profile;@@ -167,7 +168,7 @@ describe('temporal anti-aliasing as the smoothing of a level', () => {expect(qualityPassAllowed(new QualityController({ mode: 'low' }).profile, 'taa')).toBe(false);expect(qualityPassAllowed(temporal('low'), 'taa')).toBe(true);expect(qualityPassAllowed(temporal('medium'), 'fxaa')).toBe(false);- expect(qualityPassAllowed(new QualityController({ mode: 'medium' }).profile, 'fxaa')).toBe(true);+ expect(qualityPassAllowed(new QualityController({ mode: 'medium', profiles: { medium: { antialiasing: 'msaa' } } }).profile, 'fxaa')).toBe(true);// Nothing else changes.expect(qualityPassAllowed(temporal('medium'), 'bloom_extract')).toBe(true);});