Skip to content

perf(demos/face_mirror): merge wireframe Lines into one LineSegments - #368

Merged
dli7319 merged 1 commit into
google:mainfrom
salmanmkc:demos/face-mirror-polish
Jun 15, 2026
Merged

perf(demos/face_mirror): merge wireframe Lines into one LineSegments#368
dli7319 merged 1 commit into
google:mainfrom
salmanmkc:demos/face-mirror-polish

Conversation

@salmanmkc

@salmanmkc salmanmkc commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

the demo had one THREE.Line per edge of the face mesh, ~134 draw calls per frame just for the wireframe. merged into a single THREE.LineSegments sharing one BufferGeometry. one draw call, one needsUpdate flag per detection.

missing landmarks collapse to a zero-length segment so we don't render stale tails to the origin.

related: #366 (worker), #367 (BVH). all independent file-wise. spatial-HUD bar-fill anchoring is its own PR.

@salmanmkc
salmanmkc force-pushed the demos/face-mirror-polish branch from a7e7164 to f9e77c1 Compare June 15, 2026 03:59
@salmanmkc salmanmkc changed the title demos/face_mirror: wireframe + bar layout polish demos/face_mirror: merge wireframe Lines into one LineSegments Jun 15, 2026
@salmanmkc salmanmkc changed the title demos/face_mirror: merge wireframe Lines into one LineSegments perf(demos/face_mirror): merge wireframe Lines into one LineSegments Jun 15, 2026
Previously the wireframe was 134 separate THREE.Line objects, one per
edge, which meant 134 draw calls per frame just for the face mesh.
Merging into a single THREE.LineSegments with one shared
BufferGeometry collapses that to 1 draw call and 1 needsUpdate flag
per detection.

Missing landmarks collapse the edge to a zero-length segment so we
don't render stale (0, 0, 0) tails to the origin.
@dli7319
dli7319 force-pushed the demos/face-mirror-polish branch from f9e77c1 to 39b7bf5 Compare June 15, 2026 17:32
@dli7319
dli7319 merged commit f064856 into google:main Jun 15, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants