feat(billboard): add world-space SDF text billboards #955

Merged
SakulFlee merged 2 commits from feat/renderer-3d-text into main 2026-10-27 23:29:22 +00:00
Owner

Summary

Phase 7b: world-space SDF text billboards.

  • New text_billboard and text_billboard_with_background builders in orbital_billboard.
  • Builds a per-label SDF atlas from orbital_text, generates glyph quads with correct atlas UVs, and realizes the result as a normal billboard/model.
  • Text supports:
    • configurable font size, color and blend/mask alpha modes
    • optional colored outline via SDF distance
    • optional padded background quad
    • full/Y-axis/fixed billboard modes inherited from Billboard
    • perspective and orthographic cameras
    • transparent sorting with other billboards
  • The billboards example now renders an outlined "Orbital" label with a translucent background.
  • The SDF text shader is validated with naga.

Verification

  • cargo fmt --all --check
  • cargo test --workspace --no-fail-fast (exit status 0)
  • cargo check --workspace with clippy-driver and -D warnings
  • 26/26 naga WGSL tests
  • cargo test -p orbital_billboard (6 tests)
  • cargo check -p template_billboards

GUI execution is unavailable here (no display/GPU), so text orientation/readability is compile/unit-test verified only.

Stacked on #954.

Refs #781, #783, #870.

## Summary Phase 7b: world-space SDF text billboards. - New `text_billboard` and `text_billboard_with_background` builders in `orbital_billboard`. - Builds a per-label SDF atlas from `orbital_text`, generates glyph quads with correct atlas UVs, and realizes the result as a normal billboard/model. - Text supports: - configurable font size, color and blend/mask alpha modes - optional colored outline via SDF distance - optional padded background quad - full/Y-axis/fixed billboard modes inherited from `Billboard` - perspective and orthographic cameras - transparent sorting with other billboards - The billboards example now renders an outlined `"Orbital"` label with a translucent background. - The SDF text shader is validated with naga. ## Verification - `cargo fmt --all --check` - `cargo test --workspace --no-fail-fast` (exit status 0) - `cargo check --workspace` with clippy-driver and `-D warnings` - 26/26 naga WGSL tests - `cargo test -p orbital_billboard` (6 tests) - `cargo check -p template_billboards` GUI execution is unavailable here (no display/GPU), so text orientation/readability is compile/unit-test verified only. Stacked on #954. Refs #781, #783, #870.
feat(billboard): add world-space SDF text billboards
All checks were successful
Lint / lint (pull_request) Successful in 9m24s
PR / test (pull_request) Successful in 15m21s
Templates / templates (pull_request) Successful in 8m50s
0bdd34a037
Build text meshes from orbital_text's SDF atlas and realize them through the billboard component. Text supports color, optional outline, alpha cutoff/blend, and uses the same perspective/orthographic camera-facing modes as other billboards.

Add a text label to the billboards example and validate the SDF text shader with naga.

Smart test results

Result: PASS

Scope: full workspace

Reason: workspace-level change: Cargo.lock

Elapsed: 16m 5s

Workflow run

Overall: 470 tests, 460 passed, 0 failed, 10 skipped

Nextest: 459 tests, 459 passed, 0 failed, 0 skipped
Doctests: 11 tests, 1 passed, 0 failed, 10 skipped

Outcome charts are split between nextest and doctests. The timing chart covers nextest only.

Crate Nextest Passed Failed Skipped Doctests Time
orbital 1 1 0 0 - 1.43s
orbital_2d 29 29 0 0 0/1 0.16s
orbital_app 10 10 0 0 0/1 0.06s
orbital_billboard 6 6 0 0 - 0.11s
orbital_camera 8 8 0 0 - 0.06s
orbital_core 2 2 0 0 - 0.01s
orbital_debug_render 0 0 0 0 0/1 0.00s
orbital_debug_ui 45 45 0 0 0/1 0.21s
orbital_ecs 114 114 0 0 0/2 0.58s
orbital_ecs_bridge 42 42 0 0 - 0.26s
orbital_file_manager 5 5 0 0 - 0.03s
orbital_iced 25 25 0 0 - 0.14s
orbital_importer_gltf 14 14 0 0 - 0.15s
orbital_input 11 11 0 0 - 0.07s
orbital_light 6 6 0 0 - 0.04s
orbital_macros 0 0 0 0 0/1 0.00s
orbital_material_shader 2 2 0 0 - 0.01s
orbital_math 4 4 0 0 - 0.03s
orbital_procgeo 2 2 0 0 - 0.01s
orbital_render_graph 6 6 0 0 - 0.04s
orbital_renderer 9 9 0 0 - 0.05s
orbital_resources 28 28 0 0 - 0.19s
orbital_shader_core 0 0 0 0 1/1 0.00s
orbital_shader_pbr 4 4 0 0 - 0.02s
orbital_shader_preprocessor 12 12 0 0 - 0.06s
orbital_shadow 3 3 0 0 - 0.01s
orbital_text 14 14 0 0 0/1 0.31s
orbital_texture 11 11 0 0 - 0.06s
orbital_touch_ui 1 1 0 0 0/1 0.01s
orbital_ui 32 32 0 0 0/1 0.16s
orbital_world_environment 13 13 0 0 - 0.06s
pie showData
    title Nextest outcomes
    "Passed" : 459
pie showData
    title Doctest outcomes
    "Passed" : 1
    "Skipped" : 10
xychart-beta
    title "Slowest crates (nextest seconds)"
    x-axis ["orbital", "orbital_ecs", "orbital_text", "orbital_ecs_bridge", "orbital_debug_ui", "orbital_resources", "orbital_ui", "orbital_2d"]
    y-axis "Seconds" 0 --> 1.5
    bar [1.43, 0.58, 0.31, 0.26, 0.21, 0.19, 0.16, 0.16]
<!-- orbital-ci-test-results --> ## Smart test results **Result:** PASS **Scope:** full workspace **Reason:** workspace-level change: Cargo.lock **Elapsed:** 16m 5s [Workflow run](https://forgejo.sakul-flee.de/SakulFlee/Orbital/actions/runs/757) **Overall:** 470 tests, 460 passed, 0 failed, 10 skipped **Nextest:** 459 tests, 459 passed, 0 failed, 0 skipped **Doctests:** 11 tests, 1 passed, 0 failed, 10 skipped _Outcome charts are split between nextest and doctests. The timing chart covers nextest only._ | Crate | Nextest | Passed | Failed | Skipped | Doctests | Time | | --- | ---: | ---: | ---: | ---: | ---: | ---: | | orbital | 1 | 1 | 0 | 0 | - | 1.43s | | orbital_2d | 29 | 29 | 0 | 0 | 0/1 | 0.16s | | orbital_app | 10 | 10 | 0 | 0 | 0/1 | 0.06s | | orbital_billboard | 6 | 6 | 0 | 0 | - | 0.11s | | orbital_camera | 8 | 8 | 0 | 0 | - | 0.06s | | orbital_core | 2 | 2 | 0 | 0 | - | 0.01s | | orbital_debug_render | 0 | 0 | 0 | 0 | 0/1 | 0.00s | | orbital_debug_ui | 45 | 45 | 0 | 0 | 0/1 | 0.21s | | orbital_ecs | 114 | 114 | 0 | 0 | 0/2 | 0.58s | | orbital_ecs_bridge | 42 | 42 | 0 | 0 | - | 0.26s | | orbital_file_manager | 5 | 5 | 0 | 0 | - | 0.03s | | orbital_iced | 25 | 25 | 0 | 0 | - | 0.14s | | orbital_importer_gltf | 14 | 14 | 0 | 0 | - | 0.15s | | orbital_input | 11 | 11 | 0 | 0 | - | 0.07s | | orbital_light | 6 | 6 | 0 | 0 | - | 0.04s | | orbital_macros | 0 | 0 | 0 | 0 | 0/1 | 0.00s | | orbital_material_shader | 2 | 2 | 0 | 0 | - | 0.01s | | orbital_math | 4 | 4 | 0 | 0 | - | 0.03s | | orbital_procgeo | 2 | 2 | 0 | 0 | - | 0.01s | | orbital_render_graph | 6 | 6 | 0 | 0 | - | 0.04s | | orbital_renderer | 9 | 9 | 0 | 0 | - | 0.05s | | orbital_resources | 28 | 28 | 0 | 0 | - | 0.19s | | orbital_shader_core | 0 | 0 | 0 | 0 | 1/1 | 0.00s | | orbital_shader_pbr | 4 | 4 | 0 | 0 | - | 0.02s | | orbital_shader_preprocessor | 12 | 12 | 0 | 0 | - | 0.06s | | orbital_shadow | 3 | 3 | 0 | 0 | - | 0.01s | | orbital_text | 14 | 14 | 0 | 0 | 0/1 | 0.31s | | orbital_texture | 11 | 11 | 0 | 0 | - | 0.06s | | orbital_touch_ui | 1 | 1 | 0 | 0 | 0/1 | 0.01s | | orbital_ui | 32 | 32 | 0 | 0 | 0/1 | 0.16s | | orbital_world_environment | 13 | 13 | 0 | 0 | - | 0.06s | ```mermaid pie showData title Nextest outcomes "Passed" : 459 ``` ```mermaid pie showData title Doctest outcomes "Passed" : 1 "Skipped" : 10 ``` ```mermaid xychart-beta title "Slowest crates (nextest seconds)" x-axis ["orbital", "orbital_ecs", "orbital_text", "orbital_ecs_bridge", "orbital_debug_ui", "orbital_resources", "orbital_ui", "orbital_2d"] y-axis "Seconds" 0 --> 1.5 bar [1.43, 0.58, 0.31, 0.26, 0.21, 0.19, 0.16, 0.16] ```
feat(billboard): add text backgrounds and outline+background example
Some checks failed
Templates / templates (pull_request) Successful in 4m6s
Lint / lint (pull_request) Failing after 13m5s
PR / test (pull_request) Failing after 18m5s
f5633ba1c8
Text billboards can now include a padded background quad using a dedicated UV path in the SDF shader. The billboards example uses a translucent background behind the outlined label.
SakulFlee changed target branch from feat/renderer-billboards to main 2026-10-27 22:03:56 +00:00
SakulFlee force-pushed feat/renderer-3d-text from f5633ba1c8
Some checks failed
Templates / templates (pull_request) Successful in 4m6s
Lint / lint (pull_request) Failing after 13m5s
PR / test (pull_request) Failing after 18m5s
to c19a61eadb
All checks were successful
Lint / lint (pull_request) Successful in 9m14s
Templates / templates (pull_request) Successful in 6m3s
PR / test (pull_request) Successful in 18m44s
2026-10-27 22:39:13 +00:00
Compare
SakulFlee deleted branch feat/renderer-3d-text 2026-10-27 23:29:22 +00:00
Sign in to join this conversation.
No description provided.