Hacker News new | ask | show | jobs
by hugoamnov 4057 days ago
Thank you. As to the draw calls, NanoVG draws everything directly each frame so this is constant whether or not you are updating. As to the overhead, not too long ago everything was updated each frame regardless of whether it was modified or not, and performance was fine. Worse than it is now, but okay. So I guess it could handle it.

But then again, that's only the default renderer. You can always roll your own and plug it in, kiUi has been designed to permit that.

1 comments

Gotcha. I ask because, on my machine, kiUi takes 8-9ms every frame regardless of what I'm doing (e.g., typing, dragging windows, resizing things). If I'm trying to maintain 60 FPS with Emscripten, 8-9ms is a significant portion of my 16.7ms frame budget.

By comparison, a basic Emscripten libRocket demo takes 6-8ms (mostly due to Freetype rendering and its layout system, see http://forums.librocket.com/viewtopic.php?f=2&t=5223), and ImGui takes 1ms (probably due to its monospaced bitmap fonts and simple widgets, demo: http://floooh.github.io/oryol/ImGuiDemo.html).

Just some thoughts in case you're planning on adding complicated game logic every frame :)

statico: you can load a different TTF with ImGui, it doesn't have to be monospaced and they can be smooth. The perf differences are due to designing the library with performances as a major pillar, lots of things are optimised. A visual redesign is planned but it'll take a bit of time to get it done to keep the perf up.
That's great information. Thanks!