Question
We’re using DrawMode.XRay as a “glass” isolation mode. Background geometry should be very transparent; isolated nodes should stay fully solid via InstanceModifier.DoNotXRay.
After applying the sequence below, isolated nodes sometimes still look faded / low-opacity. It can get worse after camera zoom / setCamera. Does this API order look correct? Is there a known issue with DoNotXRay not sticking through draw-mode / camera updates?
Core sequence
// 1) Enable XRay (glass background)
await viewer.view.setXRayOpacity(0.05, Communicator.ElementType.Faces);
// optionally also for lines:
// await viewer.view.setXRayOpacity(0.05, Communicator.ElementType.Lines);
await viewer.view.setXRayTransparencyMode(
Communicator.TransparencyMode.Unsorted
);
await viewer.view.setDrawMode(Communicator.DrawMode.XRay);
await viewer.view.setLineVisibility(false);
// 2) Isolated nodes: selectable + exempt from XRay
const root = viewer.model.getAbsoluteRootNode();
await viewer.model.setInstanceModifier(
Communicator.InstanceModifier.DoNotSelect,
[root],
true
);
await viewer.model.setInstanceModifier(
Communicator.InstanceModifier.DoNotSelect,
slicedNodeIds,
false
);
await viewer.model.setInstanceModifier(
Communicator.InstanceModifier.DoNotXRay,
slicedNodeIds,
true
);
// 3) Keep isolated nodes visible
await viewer.model.setNodesVisibility(slicedNodeIds, true);
// NOTE: this appears to have no effect while in XRay mode:
// await viewer.model.setNodesOpacity(slicedNodeIds, 1.0);
What we observe
- Background XRay opacity works (
0.05, also tried0). setNodesOpacity(slicedNodeIds, 1.0)does not restore solid look in XRay.- We rely on
DoNotXRayfor solid isolated nodes. - Isolated nodes can still look washed out; sometimes worse after zoom / camera updates.
- Suspect either:
DoNotXRayneeds to be re-applied aftersetDrawMode(XRay)/ idle / camera change, or- something else overrides the solid appearance for those nodes.
Questions for HOOPS
- Is this the recommended order for XRay isolation with solid selected nodes?
- Should
DoNotXRaybe applied before or aftersetDrawMode(XRay)? - Does camera/
setCamerainvalidateDoNotXRay(need re-apply)? - Is
setNodesOpacityexpected to be ignored in XRay mode? - Any difference between package/body/mesh node IDs for
DoNotXRay— do child mesh nodes also need the modifier?
Environment
- HOOPS Communicator:
2025.6.1 - Browser:
Chrome - Model: BIM / IFC-style spaces + assets
Before any interaction in Xray mode.
After any interaction in Xray mode.




