Draw a silhouette outline around the selection

The renderer tints the selection blue, which says nothing about an object
that is already blue. Add a halo drawn just outside the selected objects
instead: a fixed colour against the background, so it reads whatever the
element is painted.

The mask pass reuses the main shader module and pipeline layout and shares
the main depth buffer read-only, so the halo follows the selection as
visible -- an occluded object contributes nothing. A separable dilation
widens the mask into inner and outer rings, composited after the edge pass
so the edge multiply does not darken it.

On by default; IfcViewer.setSelectionOutline(false) gets the tint alone.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dion Moult
2026-08-03 18:07:52 +10:00
parent 83a7836081
commit c9f269a0e5
6 changed files with 619 additions and 1 deletions
+11
View File
@@ -413,6 +413,17 @@
hideSelected: function () { Module._hide_selected_c(); },
isolateSelected: function () { Module._isolate_selected_c(); },
// The white-on-dark halo drawn around selected objects (on by default).
// The renderer also tints the selection blue, which says nothing when
// the object is already blue — hence a cue that does not depend on the
// object's colour. Turn it off to get the tint alone.
setSelectionOutline: function (on) {
Module._ifcv_set_selection_outline_c(on ? 1 : 0);
},
selectionOutlineEnabled: function () {
return Module._ifcv_selection_outline_is_on_c() !== 0;
},
// ---- Colour ----------------------------------------------------------
// Paint objects a flat colour, replacing whatever the model baked in.