Uh oh!
There was an error while loading. Please reload this page.
2D text at physical resolution (crisp 4K HUD) + atlas-full warning - #81
2D text at physical resolution (crisp 4K HUD) + atlas-full warning#81proggeramlug 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 |
proggeramlug
commented
Jul 8, 2026
Landed in main via the round-2 consolidation merge (#83). All commits from this branch are now on main; closing as merged-through-integration. |
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.