The demo for the lib
Running inside my alpha game project.
I ran into a snag on my project and so i did a thing to resolve it. thought it worth sharing.
Thin instances are perfect for high-volume repeated geometry — but there's a
known gap: you can't outline **one** thin-instance among many. `HighlightLayer`,
`OutlineRenderer`, and `EdgesRenderer` are all-or-nothing on a thin-instance host
(outline one, outline them all), and `InstancedMesh` can't use those layers at all.
I hit this doing per-member selection on OAR-imported linksets, so I packaged the
workaround into a small, focused, zero-Babylon-patch library:
**`@poqpoq/babylon-thin-instance-outline`**
**How it works:** a parallel inverted-hull outline mesh that is *itself* a
thin-instance host — its matrix buffer mirrors the source's at the same indices.
To highlight instance `i`, copy the source matrix into the outline buffer at `i`;
to clear it, write a scale-zero matrix. Per-instance show/hide via matrix scale is
the natural Babylon idiom, so it composes cleanly.
**What's in it (v1.3):**
- Per-thin-instance outline + **per-instance color**
- **Smooth-normals preprocess** so hard-edge meshes (cubes) get continuous outlines
- **Animated silhouette effects** — pulse, colorCycle, edgeFlow, sizzle, rimFlow —
with live param tuning (no recompile)
- Works on plain single-mesh outlines too (zero thin-instances)
**Links**
- Demo reel:
https://www.youtube.com/watch?v=7lqRXxegcow
- live interactive demo
https://poqpoq.com/babylon-outline/
- npm: `
npm install @poqpoq/babylon-thin-instance-outline
- GitHub (MIT, ADRs, 62 tests):
https://github.com/increasinglyHuman/babylon-thin-instance-outline
- to see it live in my alpha build - fair warning, it's definitely alpha - expect a wild ride if you to in to explore. It's implemented on geometry selection - or OAR import selection - you'd have to create your own sim and make some stuff - then select in build mode.
https://poqpoq.com/
**On prior art:** this is deliberately *not* a screen-space selection outliner — for a
unified group/selection outline, the native `SelectionOutlineLayer` and @noname0310's
excellent [Selection Outliner](https://forum.babylonjs.com/t/selection-outliner-blender-style-outlines/61598)
are the right tools. This fills the complementary gap: per-thin-instance,
silhouette-following, one outline per instance.
Feedback, edge cases, and PRs very welcome — curious whether others have run into the
same thin-instance limitation.

