Summary
In 0.24.3, 2D text/sprite HUD can still be occluded by 3D content unless entities are explicitly tagged with @ui.
This is surprising for ports that use plain @sprite HUD (no @ui component) and appears as "UI fix not working" from app side.
Affected versions
Milky2018/selene: 0.24.3
Milky2018/selene_raylib: 0.24.3
- macOS (Apple Silicon)
Reproduction
- Build an app with 3D scene + 2D HUD text via
@sprite.Sprite::from_text(...).
- Do not attach
@ui component to those HUD entities.
- Render a 3D scene with a camera.
- Observe HUD text/sprites are drawn under 3D.
Source-level analysis
sprite.render_sprite_system classifies commands as overlay only when entity has @ui:
selene/src/sprite/top.mbt (around is_ui = @ui.uis.get(e) is Some(_))
- raylib backend submits draw order as:
frame2d.world_commands
render_3d_frame(frame3d)
frame2d.overlay_commands
selene_raylib/src/platform_render/top.mbt
So non-UI sprites are intentionally drawn before 3D and can be occluded.
Why this still looks like a regression
In real ports, many existing HUD systems are plain sprites/text without @ui component. After moving to 3D, they suddenly get occluded although users expected "UI-over-3D" behavior from release notes.
Request
- Clarify this explicitly in docs/changelog (world vs overlay semantics).
- Consider an easier opt-in overlay path for non-
@ui sprites/text (e.g. explicit overlay flag / helper API), so migration from legacy sprite HUD is less error-prone.
Summary
In
0.24.3, 2D text/sprite HUD can still be occluded by 3D content unless entities are explicitly tagged with@ui.This is surprising for ports that use plain
@spriteHUD (no@uicomponent) and appears as "UI fix not working" from app side.Affected versions
Milky2018/selene:0.24.3Milky2018/selene_raylib:0.24.3Reproduction
@sprite.Sprite::from_text(...).@uicomponent to those HUD entities.Source-level analysis
sprite.render_sprite_systemclassifies commands asoverlayonly when entity has@ui:selene/src/sprite/top.mbt(aroundis_ui = @ui.uis.get(e) is Some(_))frame2d.world_commandsrender_3d_frame(frame3d)frame2d.overlay_commandsselene_raylib/src/platform_render/top.mbtSo non-UI sprites are intentionally drawn before 3D and can be occluded.
Why this still looks like a regression
In real ports, many existing HUD systems are plain sprites/text without
@uicomponent. After moving to 3D, they suddenly get occluded although users expected "UI-over-3D" behavior from release notes.Request
@uisprites/text (e.g. explicit overlay flag / helper API), so migration from legacy sprite HUD is less error-prone.