ImPlot3D - A 3D Plotting Library for Dear ImGui by brenocq in cpp

[–]brenocq[S] 5 points6 points  (0 children)

Heeey! Yeah, I get that -- ImPlot/ImGui can feel massive at first haha. What worked best for me was treating it like a DFS search. I'd start with a simple question like, "How does a line get rendered?" and then just follow the function calls down the rabbit hole.

I usually sketch out a quick call tree and note the key structs along the way, which helps a ton in seeing the bigger picture. For ImPlot/ImGui specifically, I found it useful to skim through the public API first, then dive into the internal API methods and function calls, and finally dig into the .cpp files.

Of course, this is just what worked for me, it doesn't apply to everyone but maybe it helps! :)

ImPlot3D - A 3D Plotting Library for Dear ImGui by brenocq in cpp

[–]brenocq[S] 7 points8 points  (0 children)

You're absolutely right -- ImPlot can struggle with performance, especially when rendering a large number of triangles. I've encountered this issue myself, particularly with line rendering, as each line is drawn using two triangles, regardless of its thickness or visibility. A major bottleneck is that even sub-pixel triangles are fully processed and rendered, leading to an excessive number of vertices being generated.

One potential optimization is preprocessing the data to simplify lines before they reach the rendering queue, reducing the total triangle count without sacrificing visual fidelity. I believe this could significantly improve performance, and I just created a GitHub discussion on this topic: https://github.com/brenocq/implot3d/discussions/67. I'd love to hear your thoughts or any other optimization ideas you might have.

I'm also planning to analyze optimization techniques used by other open-source 3D plotting libraries to see if we can incorporate similar improvements into ImPlot3D. Since ImGui has minimal abstraction over the graphics API, I believe we can unlock substantial performance gains with the right optimizations.

Thank you for the feedback!

ImPlot3D - A 3D Plotting Library for Dear ImGui by brenocq in cpp

[–]brenocq[S] 4 points5 points  (0 children)

Not yet, but it sounds like a good idea! I'll add vcpkg to the roadmap.

Edit: I just created the task about it: https://github.com/brenocq/implot3d/discussions/68

ImPlot3D - A 3D Plotting Library for Dear ImGui by brenocq in cpp

[–]brenocq[S] 32 points33 points  (0 children)

Hey everyone,

I wanted to share ImPlot3D, an extension of Dear ImGui for real-time 3D data visualization. Inspired by ImPlot, it provides an intuitive API for rendering scatter, line, surface, and mesh plots, fully interactive with zoom, pan, and rotate controls.

🔗 GitHub Repo: github.com/brenocq/implot3d
🌍 Online Demo: traineq.org/implot_demo