The inverted-hull technique in toon-shading is a "mesh-based" outline made by scaling geometry outward. OutlinePass takes a different approach — it renders only the selected object into a separate mask (silhouette), then detects that mask’s edges in screen space, blurs them, and colors them in. That means it can outline any object instantly without touching its geometry at all.
Build it with new OutlinePass(resolution, scene, camera), then change which objects get outlined at any time just by reassigning the array: outlinePass.selectedObjects = [mesh]. visibleEdgeColor (for edges not occluded by another object) and hiddenEdgeColor (for occluded parts), plus edgeStrength, edgeGlow, and edgeThickness, control thickness and glow. Set pulsePeriod and the outline pulses like a heartbeat.
The demo places three shapes and cycles selectedObjects on a timer so you see "the currently selected object" rotate through them. In production this is usually combined with something like the raycasting entry — whatever the pointer clicks or hovers gets pushed into selectedObjects.
When to use
Highlighting a selected object in a 3D editor or game, or flagging interactive targets.