HUD edit: selection wireframe sometimes not drawn on HUD attachments (depth?) #414

Closed
opened 2026-10-05 07:48:54 +00:00 by sky_line · 0 comments
Owner

When editing, the selection wireframe / highlight doesn't draw on some HUD attachments. It works on most HUDs but not all, so this may be a depth issue.

Observed (owner, 2026-10-05)

  • Selecting some HUD objects in build mode shows no wireframe/outline. Other HUDs show it fine.
  • No pattern identified yet: it could depend on the HUD's attach point, its depth (distance from the HUD camera plane), its size, the HUD's position relative to the HUD depth range, or the materials involved (alpha / fullbright / PBR).

Suspects

  • The HUD depth range: get_hud_matrices (llviewerdisplay.cpp ~385) builds an ortho projection with near 0 / far hud_depth = 1.1 × the HUD bbox X extent, then sets proj[2][2] = -0.01.
    • If the Vulkan selection/wireframe pass uses a different depth range or depth test than the HUD draw pass, HUD prims beyond some depth (or with negative X in HUD space) would fail the test or get clipped. That would match "some HUDs only".
    • Vulkan's depth range is 0..1 vs GL's -1..1. Check whether this GL-style matrix is remapped for Vulkan in the wireframe/selection path.
  • Depth test against the HUD depth buffer: if the wireframe is depth-tested against the HUD's own depth with LESS rather than LEQUAL, or without a bias, it z-fights with the surface and loses on some hardware or angles.
  • Selection rendering for HUD objects may go through the world selection path (world camera / matrices) and miss HUD-space geometry.
  • Rigged HUD attachments or HUD meshes: the wireframe may only be emitted for non-rigged prims.

Do

  • Find the Vulkan pass that draws the selection wireframe/silhouette, and how HUD selections are drawn (projection, depth test, bias, which instances it covers).
  • Reproduce with a few HUDs. Note which fail: attach point, depth, prim vs mesh, alpha.
  • Make HUD selection drawing use exactly the HUD pass's projection and depth range, with a depth bias or a depth-test mode that keeps the outline visible on the selected surface (other viewers draw the HUD selection outline without occlusion issues).

Related: #413 (the wireframe must follow the HUD zoom too).

When editing, the **selection wireframe / highlight doesn't draw on some HUD attachments**. It works on most HUDs but not all, so this may be a depth issue. ## Observed (owner, 2026-10-05) - Selecting some HUD objects in build mode shows no wireframe/outline. Other HUDs show it fine. - No pattern identified yet: it could depend on the HUD's attach point, its depth (distance from the HUD camera plane), its size, the HUD's position relative to the HUD depth range, or the materials involved (alpha / fullbright / PBR). ## Suspects - **The HUD depth range:** `get_hud_matrices` (`llviewerdisplay.cpp` ~385) builds an ortho projection with near 0 / far `hud_depth` = 1.1 × the HUD bbox X extent, then sets `proj[2][2] = -0.01`. - If the Vulkan selection/wireframe pass uses a different depth range or depth test than the HUD draw pass, HUD prims beyond some depth (or with negative X in HUD space) would fail the test or get clipped. That would match "some HUDs only". - Vulkan's depth range is 0..1 vs GL's -1..1. Check whether this GL-style matrix is remapped for Vulkan in the wireframe/selection path. - **Depth test against the HUD depth buffer:** if the wireframe is depth-tested against the HUD's own depth with LESS rather than LEQUAL, or without a bias, it z-fights with the surface and loses on some hardware or angles. - **Selection rendering for HUD objects may go through the world selection path** (world camera / matrices) and miss HUD-space geometry. - **Rigged HUD attachments or HUD meshes:** the wireframe may only be emitted for non-rigged prims. ## Do - Find the Vulkan pass that draws the selection wireframe/silhouette, and how HUD selections are drawn (projection, depth test, bias, which instances it covers). - Reproduce with a few HUDs. Note which fail: attach point, depth, prim vs mesh, alpha. - Make HUD selection drawing use exactly the HUD pass's projection and depth range, with a depth bias or a depth-test mode that keeps the outline visible on the selected surface (other viewers draw the HUD selection outline without occlusion issues). Related: #413 (the wireframe must follow the HUD zoom too).
sky_line added this to the 1.0.1 milestone 2026-10-05 09:06:17 +00:00
sky_line added this to the Slipstream project 2026-10-06 15:04:14 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#414
No description provided.