Cut the range ring's frame cost while the camera moves

The pulse level is worked out once a step, so the camera pose is read
once rather than on every call. The band's alpha is tabulated along the
radius and each pixel looks it up (0.78 ms a paint down to 0.21 ms in
Node). A line sent again where it already runs keeps its positions, so the
polyline collection does not rewrite the ring's vertices on every step.

The band test now compares images byte by byte. A failing deepEqual on a
256x256 image builds a diff of every byte, and that ran a test process
out of memory.
This commit is contained in:
Sameh Khamis committed 2026-11-10 07:59:23 -08:00
1 parent 74d6d97b29
commit e4af6c8ed7
4 files changed
+103 -18

No files matched your search

+6
View File
@@ -2954,10 +2954,16 @@ test('an outlined solid line draws one outline material, recoloured in place, an
return null;
};
const first = line();
const drawnPositions = first.positions;
assert.equal(first.material.type, 'PolylineOutline');
assert.equal(first.material.uniforms.outlineWidth, 1);
s.set.upsert([outlined([0, 0.5, 1, 0.4], [0, 0, 0, 0.32])]);
assert.equal(line(), first, 'the same line');
assert.equal(
first.positions,
drawnPositions,
'positions sent again where they were are not rewritten',
);
assert.equal(first.material.uniforms.color.alpha, 0.4);
assert.ok(
Math.abs(first.material.uniforms.outlineColor.alpha - 0.32) < 1e-9,