You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm creating a high-performance low-level UI library https://github.com/MeadowlarkDAW/firewheel. It uses femtovg for rendering 2D shapes on the GPU using OpenGL, however the built-in text rendering is poor quality so I want to replace it with cosmic-text.
I understand that cosmic-text renders on the CPU, and that's fine. My question is what is the recommended and/or most efficient way to send textures to the GPU?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm creating a high-performance low-level UI library https://github.com/MeadowlarkDAW/firewheel. It uses
femtovg
for rendering 2D shapes on the GPU using OpenGL, however the built-in text rendering is poor quality so I want to replace it withcosmic-text
.I understand that
cosmic-text
renders on the CPU, and that's fine. My question is what is the recommended and/or most efficient way to send textures to the GPU?In your examples, it appears you render the whole line of text into a single texture on the CPU and then send that texture to the GPU https://github.com/pop-os/cosmic-text/blob/main/examples/editor-libcosmic/src/text.rs.
The Vizia UI library takes a different approach by caching each glyph into a texture atlas and then sending commands to the GPU to sample each glyph one at a time from that atlas https://github.com/vizia/vizia/blob/main/crates/vizia_core/src/text/cosmic.rs.
Beta Was this translation helpful? Give feedback.
All reactions