HUD hover text rendered in the world instead of on the HUD #92

Open
opened 2026-09-27 06:40:10 +00:00 by backspace119 · 1 comment
Owner

Reported by tester (before the #90 crash): hover text (llSetText) that belongs on a HUD was drawn in the world at a seemingly random spot - possibly near the sim centre / region origin.

How LL decides

LLHUDText::mOnHUDAttachment routes text: HUD texts go to sVisibleHUDTextObjects -> drawn by LLHUDText::renderAllHUD() with the HUD camera; world texts via LLHUDObject::renderAll() -> LLHUDText::render() (skips HUD texts). The flag is set when the text is created (llviewerobject.cpp:6085, isHUDAttachment()) and when an object is attached/detached (llviewerjointattachment.cpp:232-241 / 332-341, root + children).

Hypotheses

  1. Flag stale / wrong: text created while the object wasn't yet known as a HUD attachment (e.g. temp-attached experience HUDs, or a child prim whose text arrives before/after the attach walk), and never updated -> HUD-space position rendered with the world camera. HUD-space coordinates are small (~metres around the HUD origin), which in agent space lands near the region origin - fits "random spot, maybe near sim centre".
  2. VK routing: the VK world-overlay path (llappviewer.cpp uiRender) calls LLHUDObject::renderAll() with the world camera and LLHUDText::renderAllHUD() with the HUD camera only when world.hud_enabled - check the HUD camera matrices for HUD text (setVKOverlayCamera(world.hud_proj_ui, world.hud_model)) and that nothing HUD-flagged reaches the world pass.

Repro needed

Which HUD (worn from inventory vs experience temp-attach), and does the text move with the camera or sit at a fixed world spot?

**Reported by tester (before the #90 crash):** hover text (llSetText) that belongs on a **HUD** was drawn **in the world** at a seemingly random spot - possibly near the sim centre / region origin. ### How LL decides `LLHUDText::mOnHUDAttachment` routes text: HUD texts go to `sVisibleHUDTextObjects` -> drawn by `LLHUDText::renderAllHUD()` with the HUD camera; world texts via `LLHUDObject::renderAll()` -> `LLHUDText::render()` (skips HUD texts). The flag is set when the text is created (`llviewerobject.cpp:6085`, `isHUDAttachment()`) and when an object is attached/detached (`llviewerjointattachment.cpp:232-241 / 332-341`, root + children). ### Hypotheses 1. **Flag stale / wrong:** text created while the object wasn't yet known as a HUD attachment (e.g. temp-attached experience HUDs, or a child prim whose text arrives before/after the attach walk), and never updated -> HUD-space position rendered with the **world** camera. HUD-space coordinates are small (~metres around the HUD origin), which in agent space lands near the region origin - fits "random spot, maybe near sim centre". 2. **VK routing:** the VK world-overlay path (llappviewer.cpp uiRender) calls `LLHUDObject::renderAll()` with the world camera and `LLHUDText::renderAllHUD()` with the HUD camera only when `world.hud_enabled` - check the HUD camera matrices for HUD text (`setVKOverlayCamera(world.hud_proj_ui, world.hud_model)`) and that nothing HUD-flagged reaches the world pass. ### Repro needed Which HUD (worn from inventory vs experience temp-attach), and does the text move with the camera or sit at a fixed world spot?
Author
Owner

Tester on vk-2026.09.27.2: HUD text still renders in-world, so the root-flag change (654c07053f) wasn't the cause (harmless, kept).

Real cause: hud_render_text (llhudrender.cpp) projects each label with glm::project(pos, get_current_modelview(), get_current_projection(), viewport). LL's GL HUD pass loads the HUD matrices into those first; under VK they hold the world camera all frame (buildVulkanWorldFrame), so HUD-space positions were projected through the world camera -> text in-world near the region origin.

Fix (pending build/tester): the VK uiRender HUD-text block loads get_hud_matrices() (GL convention) around LLHUDText::renderAllHUD() and restores the world matrices after.

Tester on vk-2026.09.27.2: HUD text **still** renders in-world, so the root-flag change (654c07053f) wasn't the cause (harmless, kept). **Real cause:** `hud_render_text` (llhudrender.cpp) projects each label with `glm::project(pos, get_current_modelview(), get_current_projection(), viewport)`. LL's GL HUD pass loads the HUD matrices into those first; under VK they hold the **world** camera all frame (buildVulkanWorldFrame), so HUD-space positions were projected through the world camera -> text in-world near the region origin. **Fix (pending build/tester):** the VK uiRender HUD-text block loads `get_hud_matrices()` (GL convention) around `LLHUDText::renderAllHUD()` and restores the world matrices after.
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
backspace119/Slipstream#92
No description provided.