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(render): a gamma cutout with no effect is antialiased too

esenginef910ce0992bd
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5833a898a..c143bda91 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,7 +16,7 @@ published separately; it ships inside the editor.
### Added
-- **A cutout's edge is antialiased.** With multisampling on (the default), a material with an alpha cutoff turns its alpha into multisample coverage along the cut instead of testing it, so leaves, grass and fences stop stair-stepping at their edges. A shader opts in with `#pragma coverage <param>`, which the built-in Model shader declares for `u_alphaCutoff`; a material without a cutoff, and a blended one, draw as before. A project in gamma space with no post-processing has no multisampled target, and there the cut stays hard.
+- **A cutout's edge is antialiased.** With multisampling on (the default), a material with an alpha cutoff turns its alpha into multisample coverage along the cut instead of testing it, so leaves, grass and fences stop stair-stepping at their edges. A shader opts in with `#pragma coverage <param>`, which the built-in Model shader declares for `u_alphaCutoff`; a material without a cutoff, and a blended one, draw as before. It holds in gamma projects with no post-processing too, which draw straight into the multisampled surface.
- **Project Health names the textures a material reads as data while they are still decoded as colour.** In a linear project, a normal map or packed roughness marked sRGB is bent on the way in; models imported before 0.74 left every one of them that way. The report lists them in one finding and its Fix turns sRGB off on all of them. Which texture params hold numbers is the shader's to say: `#pragma param … texture … texel(data)`, which the built-in Model and Lit shaders now declare. The same report names settings in `project.esproject` that nothing reads.
- **Importing a model brings its lights and cameras.** A glTF's `KHR_lights_punctual` lights and its cameras, and an FBX's point, directional and spot lights and its cameras, become Light and Camera components on their nodes, turned to face -Z as the engine's do. Colour, cone angles, reach, field of view and clip planes carry over; intensity is carried over as the file states it, as Godot's importers do, since the engine's has no photometric unit. An imported camera is never the active one. ORCA Bistro's own camera arrives exactly where its official view was set up by hand; area and volume lights are named and skipped.
- **A cutout's mip levels keep its coverage.** A texture a material cuts at an alpha threshold is encoded with each mip level's alpha rescaled so the share of texels past the cut stays what it is at full size; plain averaging thins it until distant railings and fences are gone. Bistro's wrought-iron texture keeps 14% of its texels past the cut at 32 and 16 px, where averaging leaves 4% and none. Importing a model sets it (Mip Coverage Cutoff, an advanced texture setting) on the base colour of every cutout material, also when a blended material shares the image. It applies to UASTC KTX2 textures, which such a texture now stays even when larger than its image.
diff --git a/tools/renderScenes.mjs b/tools/renderScenes.mjs
index 0ee681a6a..9a1a52763 100644
--- a/tools/renderScenes.mjs
+++ b/tools/renderScenes.mjs
@@ -709,6 +709,10 @@ export const SCENES = [
// multisampling on, coverage from alpha makes the texel before the cut a blend in a
// share of rows (0.35 WebGL2, 0.26 WebGPU) that an alpha test does not (0.14, 0.07).
{ id: "corpus-cutout-edge", tier: "pr", webgpu: true, corpora: ["khronos-alpha-blend-mode-test"], env: { ESTELLA_VERIFY_PREFAB: "/corpora/khronos-alpha-blend-mode-test/imported/AlphaBlendModeTest.esprefab", ESTELLA_VERIFY_SCENE: "/scenes/corpus-cutout-edge.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/corpus-alpha-modes.textures.json", ESTELLA_VERIFY_COLORSPACE: "linear", ESTELLA_VERIFY_MSAA: "4", ESTELLA_VERIFY_W: "640", ESTELLA_VERIFY_H: "640", ESTELLA_VERIFY_STEPS: "8", ESTELLA_VERIFY_CUTOUT_EDGE: "{\"box\":[0.5813,0.4219,0.6641,0.6875],\"lit\":180,\"run\":4,\"partial\":[115,180],\"minShare\":0.2}" } },
+ // The same cut in gamma with no effect: no chain, so the frame draws straight into
+ // the surface, which is multisampled too (0.27 WebGL2, 0.26 WebGPU; 0.12 on WebGPU
+ // asking for one sample). A WebGL2 canvas is antialiased whatever the engine asks.
+ { id: "corpus-cutout-edge-gamma", tier: "pr", webgpu: true, corpora: ["khronos-alpha-blend-mode-test"], env: { ESTELLA_VERIFY_PREFAB: "/corpora/khronos-alpha-blend-mode-test/imported/AlphaBlendModeTest.esprefab", ESTELLA_VERIFY_SCENE: "/scenes/corpus-cutout-edge.esscene", ESTELLA_VERIFY_MANIFEST: "/scenes/corpus-alpha-modes.textures.json", ESTELLA_VERIFY_MSAA: "4", ESTELLA_VERIFY_W: "640", ESTELLA_VERIFY_H: "640", ESTELLA_VERIFY_STEPS: "8", ESTELLA_VERIFY_CUTOUT_EDGE: "{\"box\":[0.5813,0.4219,0.6641,0.6875],\"lit\":180,\"run\":4,\"partial\":[115,180],\"minShare\":0.2}" } },
// The same asset forty metres off, its textures uploaded as a shipped game's are:
// with a mip chain the stripes average to a flat tint (ripple 7.8), sampling the top
// level they shimmer (17.5); 7.9 on WebGPU, 13.7 before it built a chain.