Skip to content

3D engine that AI agents drive

Pin the outline edge test and note lead approval (#1744)

Nguyen Xuan An41e627cf018f
diff --git a/changes/1744-outline.size.md b/changes/1744-outline.size.md
index c2d37f41..daf05b6c 100644
--- a/changes/1744-outline.size.md
+++ b/changes/1744-outline.size.md
@@ -1 +1 @@
-- entry:gaussian-splats: about 510 bytes gzip for the outline option (width and colour checks, the grown-quad vertex shader and the outline fragment shader), the dark silhouette line pixel-art users otherwise draw in a separate image pass after every frame (#1744). Measured by minifying the entry with and without the outline module.
+- entry:gaussian-splats: about 510 bytes gzip for the outline option (width and colour checks, the grown-quad vertex shader and the outline fragment shader), the dark silhouette line pixel-art users otherwise draw in a separate image pass after every frame (#1744). Measured by minifying the entry with and without the outline module. Approved by lead: an opt-in, visible capability.
diff --git a/tests/gaussian-splat-outline.test.js b/tests/gaussian-splat-outline.test.js
index e88dd775..998fc0d0 100644
--- a/tests/gaussian-splat-outline.test.js
+++ b/tests/gaussian-splat-outline.test.js
@@ -133,3 +133,8 @@ test('an outline scene draws the grown quads first, without depth write, then th
test('the outline vertex shader refuses a vertex shader it cannot grow', () => {
assert.throws(() => buildOutlineVertexSource('void main() {}'), /no longer contains/);
});
+
+test('the outline fragment shader tests the distance to the disc edge against the width', () => {
+ assert.match(OUTLINE_FRAGMENT_SOURCE, /dFdx\(inside\), dFdy\(inside\)/);
+ assert.match(OUTLINE_FRAGMENT_SOURCE, /if \(-inside \/ gradient > outlineWidth\) discard;/);
+});