Upgrade Dear Imgui to 1.92.8#6356
Conversation
- Primary new feature is improved font texture handling pipeline, obsoleting a lot of our custom glyph management code.
Allow rendering ImGui elements in a 3d scene with proper depth values and depth testing.
- No need to manually keep a font texture in the Renderer object. - Simple API for sub-rect data uploads to support just-in-time font glyph rasterization.
|
On a fresh build /pioneer/src/pigui/PiGui.cpp:243:27: error: qualified name does not name a class before ‘{’ token
243 | struct PiGui::PiSVGLoader {
| ^
/home/zonkmachine/builds/pioneer/src/pigui/PiGui.cpp: In member function ‘void PiGui::Instance::LoadFontDefinitionFromFile(const std::string&)’:
/home/zonkmachine/builds/pioneer/src/pigui/PiGui.cpp:427:42: error: ‘PiSVGLoader’ has not been declared
427 | cfg.FontLoader = PiSVGLoader::GetFontLoader();
| ^~~~~~~~~~~
|
- Drop all external font-size management code, fonts are now fully managed by ImGui. - Implement custom ImFontLoader for loading gridded SVG icons. - Because glyphs and baked font faces are loaded on-demand, we need a two-stage pipeline; pixel data is reserved inside the loader and committed once the rasterization task is complete, typically 1+ frames later. - The font loader has stub support for horizontal/vertical oversampling of SVG icons for improved anti-aliasing and details at small sizes. - SVG icon font data now has a canonical file representation, rather than duplicating it between multiple files.
- The old hack of rendering text at a size separate from the font size doesn't work anymore, so an explicit maximum font size is required. - Ideally a better solution could be found (e.g. distance-field fonts) for infinitely scalable fonts without infinitely-expanding memory.
- Major breaking change in PathStroke() API - SectorMap changes necessitated an alteration in shutdown order (destroy Lua before PiGui so the Lua-owned SectorMap instance doesn't keep an ImDrawList alive) - Removal of utils.h from PiGui.h required some include fixups
|
Good catch, thank you! My GCC version is a bit newer it would seem, as it has no problems with whatever C++ witchery I managed to accidentally commit. |
@sturnclaw I'll try to dig into this if I can keep up with you. Although I personally like large letters that fill half the screen, they become more transparent and do not interfere (in my opinion) with view. |
I've not (yet) gone through all of the intervening releases and dealt with all of the major/breaking changes from each, but this PR has the headlining feature of an improved font rendering stack.
We've entirely gotten rid of our patch-based intrusive glyph tracking system, and have adopted ImGui's new default scalable font rasterization. As a consequence, most font glyphs (especially outside the Latin-1 range, for non-English languages) should seamlessly load on the same frame they are used, with no need for a 1-frame delay to rebuild the font atlas anymore.
We have a new workaround for handling SVG font loading, as rasterizing the icon grid at large scales is still prohibitively expensive. We defer uploading missing icon glyph data until it becomes available, which will result in a 1-2 frame "pop in" as icons are rendered at new sizes.
I've had to do some rocket surgery to the Sector Map label rendering (cc @Gliese852), and would like to formally adopt a maximum size limit to labels in the map - they don't need to cover 1/4 of the viewport when very close to the camera. There is already a hacky maximum size limit I added to prevent out-of-memory conditions, but I'd appreciate a hand with changing the label system to use de-projected coordinates rather than the NDC Z coordinate directly...
Consider this PR a WIP that I intend to finish in the next few days - it's already taken ~12 hours to get to this state.