2D text at physical resolution (crisp 4K HUD) + atlas-full warning#81
Closed
proggeramlug wants to merge 1 commit into
Closed
2D text at physical resolution (crisp 4K HUD) + atlas-full warning#81proggeramlug wants to merge 1 commit into
proggeramlug wants to merge 1 commit into
Conversation
Round-2 audit F5: glyphs were rasterized at LOGICAL pixel size and the 2D projection stretched them x1.5 at 150% display scaling — every HUD string was a bilinear-magnified blur at 4K. - draw_text_ex rasterizes at size x dpi (dpi = physical surface width / logical width) and divides the layout metrics back to logical, so the projection's stretch lands the bitmap 1:1 on physical pixels. - measureText stays in logical units and stays exact: fontdue advances are strictly linear in pixel size, so advance(phys)/dpi == advance(logical) up to f32 rounding. - The glyph atlas warns once when full instead of silently wrapping UVs into garbage glyphs (grow/evict is the durable follow-up; the physical-size cache entries raise pressure, so the warning matters now). Validated on the live game at 4K: title + HUD render with correct layout and native-res rasters; no atlas warnings on the shooter's glyph set.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Contributor
Author
|
Landed in main via the round-2 consolidation merge (#83). All commits from this branch are now on main; closing as merged-through-integration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #76 (it builds on the 2D gamma change in
text_renderer.rs). Audit F5's remaining half.The fix
Glyphs rasterized at logical size were stretched ×1.5 by the 2D projection at 150% display scaling — the whole HUD was a bilinear blur at 4K. Now:
draw_text_exrasterizes atsize × dpi(physical/logical surface ratio) and scales layout metrics back to logical — the projection's stretch lands bitmaps 1:1 on physical pixels.measureTextis untouched and stays exact: fontdue advances are strictly linear in pixel size, so logical measurement ≡ drawn advance.Validated on the live game at 4K: correct layout/centering, native-res rasters, no warnings on the shooter's glyph set.