Dear Imgui / Imgui Bundle UI integration for UPBGE and RanGE!

Recently updated my imgui integration for BGE, so I thought I’d make a post here.

Dear Imgui is a fully-featured UI system built on the IMGUI paradigm - which basically means the UI is updated every frame using a really simple API. (Now this doesn’t mean it’s slow, because it actually doesn’t do immediate-mode rendering, instead it generates a fast vertex buffer for the GPU to render).

Anyways, I didn’t want to have to write a whole UI library from scratch, and imgui is pretty cool, so I decided to just cram imgui into upbge! can’t be too difficult, right? :stuck_out_tongue: Turned out to be a lot of PyOpenGL wackiness, but I eventually got it working.

Features

Credit to the imgui_bundle library here for the amazing python bindings and example opengl integrations. Also originally used the pyimgui library for rendering and initial integration. And of course, credit to the original Dear Imgui library by ocornut here

  • Full windowing system
  • Docking support
  • Viewports in 3D using textures as well as main 2D UI
  • Wrapper classes to easily use the library with bge

This is a mainly python-based library, so to make UI you will need to know some basic python.

Some videos

Check out the code here:

6 Likes

Great job! I’m using it in my game and it’s phenomenal!!

Wow, this is phenomenal!

To use this we have to install imgui into UPBGE, right?

The install-video on the github page isn’t accessable anymore sadly.
And: Does it work on UPBGE 0.3?

Yes, it should work on UPBGE 0.3.

For Eevee-NEXT, IIRC normal UI windows work fine. However, 3D textured UI panels require being able to set a custom texture, and the API has changed. (bge.Texture no longer works, or if it does, I haven’t been able to get it to work). If someone has an example for dynamic FBO textures in Eevee Next, I can fix that bug pretty easily.