Skip to content

ImGui integration does not support drawing lots of elements (ImGuiBackendFlags_RendererHasVtxOffset) #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
arximboldi opened this issue Mar 16, 2021 · 7 comments

Comments

@arximboldi
Copy link
Contributor

Hi!

When drawing meshes with more than 64K elements with ImGui the backend needs to support ImGuiBackendFlags_RendererHasVtxOffset

Looking at it, it should not be very difficult for the Magnum integration to do this. One can check their official OpenGL3 renderer for reference:
https://github.com/ocornut/imgui/blob/6a161b878943241ddecbeee4ae27103dbd2d33d0/backends/imgui_impl_opengl3.cpp

Cheers!

@mosra mosra added this to the 2020.0b milestone Mar 16, 2021
@mosra
Copy link
Owner

mosra commented Mar 16, 2021

Hi,

I was aware of this feature and it was on my TODO list for quite some time, but I treated it more like a perf optimization than a blocker (IIRC it can reduce some work this way), which is why it's not there yet :) Coincidentally, Magnum recently got support for vertex offset for GLES and WebGL (for some reason it's an extreme problem to specify vertex offset on those platforms), so this feature could be added not just for desktop GL.

Unfortunately at this point I'm rather busy with other things so I can't promise any ETA when this gets done.

(Or maybe @Squareys could have an use for this as well? Haha.)

@arximboldi
Copy link
Contributor Author

No worries! I worked-around this so far by using ImDrawIdx=unsigned int. I agree this can be considered an optimization rather than a bug (it's only mildly annoying because one has to figure out what is going on when one starts experiencing data truncation in ImGui).

In any case, thanks for the super-quick response and all the great work in this library. Magnum is a very well engineered library! ❤️

@mosra
Copy link
Owner

mosra commented Mar 16, 2021

Ah, if that works that's great.

Btw., can you share what you're using Magnum for? :) I'm wondering what use case involves drawing thousands of GUI elements.

@arximboldi
Copy link
Contributor Author

Sadly I can't share but I can tell you it's a cool project in the domain of movie-making :)

The ImGui limit was hit though while using this library to plot dense graphs: https://github.com/epezent/implot

@Squareys
Copy link
Contributor

Yeah, this sounds useful! I'm using implot, too, but surprisingly haven't hit the limit yet 🤔
Unfortunately I don't believe I'd get to implementing this too soon either, though.

@mosra
Copy link
Owner

mosra commented Feb 8, 2022

Fixed with #90.

@mosra mosra closed this as completed Feb 8, 2022
@arximboldi
Copy link
Contributor Author

arximboldi commented Feb 8, 2022

Thank you so much @mosra and @pezcode 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants