perf(all-in-one): lower room label font and atlas resolution #1100

Merged
SakulFlee merged 2 commits from sakulflee/aio-label-resolution into main 2026-11-11 02:15:34 +00:00 AGit
Owner

Summary

The AiO room labels rendered at 128 px into a private 1024x1024 atlas per label. They are read from the hallway, 6-20 m away, so most of that detail is wasted.

  • TextConfig and Text can now select the square SDF atlas edge length; the billboard builder no longer hard-codes 1024x1024.
  • The AiO room labels use a 64 px font in a 512x512 atlas, with world_scale doubled from 0.00225 to 0.0045 to preserve the on-screen size.

Measurements

Release build, all eight AiO labels, including the spawn and first-frame rebuild passes:

Font Atlas Atlas build Per-label atlas
128 px 1024x1024 11.1 s 4 MiB
96 px 512x512 4.4 s 1 MiB
64 px 512x512 1.1 s 1 MiB

The 96 px variant was only marginally crisper on the nearest sign. At normal room distance the 64 px labels remain readable, so 64 px is the better trade.

Verification

  • cargo fmt --all -- --check
  • cargo clippy -- -D warnings
  • cargo test --no-fail-fast
  • Ran template_all_in_one and compared the 128/1024 and 64/512 labels from the default hallway camera.

Closes #1071.

## Summary The AiO room labels rendered at 128 px into a private 1024x1024 atlas per label. They are read from the hallway, 6-20 m away, so most of that detail is wasted. - `TextConfig` and `Text` can now select the square SDF atlas edge length; the billboard builder no longer hard-codes 1024x1024. - The AiO room labels use a 64 px font in a 512x512 atlas, with `world_scale` doubled from 0.00225 to 0.0045 to preserve the on-screen size. ## Measurements Release build, all eight AiO labels, including the spawn and first-frame rebuild passes: | Font | Atlas | Atlas build | Per-label atlas | |------|-------|-------------|-----------------| | 128 px | 1024x1024 | 11.1 s | 4 MiB | | 96 px | 512x512 | 4.4 s | 1 MiB | | 64 px | 512x512 | 1.1 s | 1 MiB | The 96 px variant was only marginally crisper on the nearest sign. At normal room distance the 64 px labels remain readable, so 64 px is the better trade. ## Verification - `cargo fmt --all -- --check` - `cargo clippy -- -D warnings` - `cargo test --no-fail-fast` - Ran `template_all_in_one` and compared the 128/1024 and 64/512 labels from the default hallway camera. Closes #1071.
TextConfig now carries the square SDF atlas edge length for world-space
billboards instead of the billboard builder hard-coding 1024x1024. Text
stores the same value and exposes it through the ECS inspector, so label
rebuilds keep the authored resolution.

A single glyph always fits: the billboard builder clamps the requested
size to the configured font size plus padding.
perf(all-in-one): lower room label font and atlas resolution
All checks were successful
Lint / lint (pull_request) Successful in 1m29s
PR / test (pull_request) Successful in 4m5s
Templates / templates (pull_request) Successful in 3m25s
2571a5c142
The AiO room labels used a 128 px SDF font and a private 1024x1024 atlas
per label, although they are read from 6-20 m away. Use a 64 px font into
a 512x512 atlas and double world_scale to keep the on-screen size.

Release-build atlas construction for the label set, including the
first-frame text rebuild, drops from 11.1 s to 1.1 s. Per-label atlas
memory drops from 4 MiB to 1 MiB. The 96 px variant measurably cost 4.4 s
and was only marginally crisper on the nearest sign.

Closes #1071.

Smart test results

Result: PASS

Scope: orbital_billboard, orbital_text

Reason: directly changed crates

Elapsed: 3m 18s

Workflow run

Overall: 29 tests, 28 passed, 0 failed, 1 skipped

Nextest: 28 tests, 28 passed, 0 failed, 0 skipped
Doctests: 1 tests, 0 passed, 0 failed, 1 skipped

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

Crate Nextest Passed Failed Skipped Doctests Time
orbital_billboard 13 13 0 0 - 3.61s
orbital_text 15 15 0 0 0/1 0.34s
pie showData
    title Nextest outcomes
    "Passed" : 28
pie showData
    title Doctest outcomes
    "Skipped" : 1
xychart-beta
    title "Slowest crates (nextest seconds)"
    x-axis ["orbital_billboard", "orbital_text"]
    y-axis "Seconds" 0 --> 3.7
    bar [3.61, 0.34]
<!-- orbital-ci-test-results --> ## Smart test results **Result:** PASS **Scope:** orbital_billboard, orbital_text **Reason:** directly changed crates **Elapsed:** 3m 18s [Workflow run](https://forgejo.sakul-flee.de/SakulFlee/Orbital/actions/runs/1248) **Overall:** 29 tests, 28 passed, 0 failed, 1 skipped **Nextest:** 28 tests, 28 passed, 0 failed, 0 skipped **Doctests:** 1 tests, 0 passed, 0 failed, 1 skipped _Outcome charts are split between nextest and doctests. The timing chart covers nextest only._ | Crate | Nextest | Passed | Failed | Skipped | Doctests | Time | | --- | ---: | ---: | ---: | ---: | ---: | ---: | | orbital_billboard | 13 | 13 | 0 | 0 | - | 3.61s | | orbital_text | 15 | 15 | 0 | 0 | 0/1 | 0.34s | ```mermaid pie showData title Nextest outcomes "Passed" : 28 ``` ```mermaid pie showData title Doctest outcomes "Skipped" : 1 ``` ```mermaid xychart-beta title "Slowest crates (nextest seconds)" x-axis ["orbital_billboard", "orbital_text"] y-axis "Seconds" 0 --> 3.7 bar [3.61, 0.34] ```
SakulFlee force-pushed sakulflee/aio-label-resolution from 2571a5c142
All checks were successful
Lint / lint (pull_request) Successful in 1m29s
PR / test (pull_request) Successful in 4m5s
Templates / templates (pull_request) Successful in 3m25s
to 107b7e6c9a
All checks were successful
Lint / lint (pull_request) Successful in 1m15s
Templates / templates (pull_request) Successful in 1m56s
PR / test (pull_request) Successful in 3m33s
2026-11-11 02:04:57 +00:00
Compare
chore: refresh pull request metadata
Some checks failed
Lint / lint (pull_request) Has been cancelled
PR / test (pull_request) Has been cancelled
Templates / templates (pull_request) Has been cancelled
435a915aaa
SakulFlee force-pushed sakulflee/aio-label-resolution from 435a915aaa
Some checks failed
Lint / lint (pull_request) Has been cancelled
PR / test (pull_request) Has been cancelled
Templates / templates (pull_request) Has been cancelled
to 107b7e6c9a
All checks were successful
Lint / lint (pull_request) Successful in 1m15s
Templates / templates (pull_request) Successful in 1m56s
PR / test (pull_request) Successful in 3m33s
2026-11-11 02:05:35 +00:00
Compare
Author
Owner

Closes #1017

Closes #1017
Sign in to join this conversation.
No description provided.