Sharing of debug & lemur utils

Well, I wanted to share some debug utilities I made.

It is separated per category and AppStates, which includes:

  • Mesh debugger - Gives many different views: wired, wired with random colors, flat with random colors, “normals colors”…
  • Normals debugger - Shows the normals with lines or arrows.
  • Bounds debugger - Shows the bounds of the given spatials.
  • Skeleton debugger - Shows the skeleton bones with lines (using internally the skeletondebugger).

This debugs are meant to be used with a given spatial (which can be the rootNode, so the whole scene). They are also auto-updated (what means, if any spatial is attached to the debugged one or it subtree hierarchy, it is automatically debugged too).

Additionally there is also an “asset reloader”, which automatically tracks material files changes and reload them. This is to be changed to a “debugger appstate” too but… is not currently done xD.

How to use them

In the repository there is also a DebugCommand, which is how I use it, but basically attaching a new instance of the desired debugger with the wanted paremeters to the stateManager. (However, all this states rely on a global properties state, which gives them some needed common things, such as the debugged spatial, the rootNode being use, a thread pool, etc).

¿What do this has to do with lemur?

Frankly… not much :stuck_out_tongue:, but ey!, these are better if you can use them in-game, on runtime, so a kind of console is needed, and there is where lemur appears. In that repository there is also other panels:

  • Console - It shows a visual console to enter commands or display logs (or both). This one is located on the top of the screen and being as wide as it.
  • Viewport Panel - It’s a Just-Attach-Like-Another-Lemur-Component panel, which have the behavior of a panel but with the peculiarity that shows a viewport instead of a background (the JALALC is a bit tricky, as the panel attaches a control to the root node of where it is attached, normally the guiNode, and checks every frame for a change in it farthest ancestor. If it isn’t the same, it removes the viewport).
  • Viewport2D Panel - Extents the former (which shows a 3D viewport) but showing a 2D scene (just as the gui-node), which is very useful to add more panels inside and have “clipping”.

¿Are this things bug-proof?

They work well for us :wink:

Extra things

In the repositories there are many other “utilities”, some more useful than others xD. Ok, neither of them too useful, but there is one to mention, the “MergeUtil”. We use this one to merge many objects with different geometries and skeletons/animations into a single one with all it bones and animations… it may sound strange (think on a wearing system) and what is sure is that is cpu-intensive enough to expect a small fps drop when using it.

A picture is worth a thousand words

Some of the options looks like:

Debug normals (lines)

Debug normals (arrows)

Debug meshes (flat colors)

Debug meshes (wired)

Debug meshes (wired colors)

Debug meshes (normals colors)

Debug selected (normal arrows)

Combined debug (flat colors + normal lines)

Debug bounds (nodes = yellow, geometries = green)

Lemur console

Lemur viewport panels (left → 3D viewport, right → 2D viewport)


Thanks so much for sharing them. :grinning:

Yeah, pretty neat.


I was needing a mechanism to preview 3D stuffs in gui elements, and tested the ViewportPanel, and it works fine.

Directly adding to panel node : (on default gui viewport)
Model renders faulty

Using ViewportPanel :
Model renders fine

@Xelun and @NemesisMate again thanks so much for sharing. :slight_smile:

1 Like

You are welcome. We use other people shares so the less we can do is to share the things that are usable by others too. I’ve just pushed some changes to github that improves a little bit the way the viewportpanel is handled. It’s working fine for us but I’m not sure if it works perfect in other cases. So… If you find any bug you can always submit it.

1 Like

Thank you so much :grinning:
I will inform if I found any bug.


came along by collecting information about lemur ui and found this nice contribution. Will try it and already thanks for sharing !

One question: Is it planned to upload a version to maven/jitpack/whatever-repo ?


Well, as I said, this isn’t really something though to be deployed and used by others. The more mature stuff in there (and reusable as is) I would say is the lemur’s viewport panel, which was working pretty fine the last time I tried it. So no, I don’t plan to upload it anywhere else than github.

PD: Sorry for the late response, I just have internet after 3 months, I have a lot of catch-up to do :stuck_out_tongue:

1 Like

It’s been really hard to find some time for this. I’ve moved all to a single repository and made it usable through jitpack (not ideal but something) so now the utilites can be used as a gradle dependency.

The new repo is: GitHub - NemesisMate/util-jme3