Low frame rate due to use of lemurs

     public Node HitPointUI(){
        ProgressBar bossHealth = new ProgressBar(new DefaultRangedValueModel(0, 100, 100));
    //    bossHealth.setMessage("HP");
        bossHealth.getValueIndicator().setBackground(new QuadBackgroundComponent(ColorRGBA.Red));
        bossHealth.setPreferredSize(new Vector3f(10f, 2.5f, 0f));
        bossHealth.setLocalTranslation(0f, 5f, 0f);//还没找到让血条显示在正中间的方法
        bossHealth.addControl(new BillboardControl());
        bossHealth.setProgressPercent(0.5f);
        bossHealth.setShadowMode(ShadowMode.Off);
        return bossHealth;
        
    }

I want to use lemurs to show the health value of each unit

I wonder if my incorrect use of the lemur is causing the bottom framerate

Here’s what it looks like with no health values displayed, looks like everything is fine with 100 units in the screen


When I add on the lemur UI there is a problem, I don’t know what is causing the low fps, but I tried some measures but nothing works

        mouseState=simpleApp.getStateManager().getState(MouseAppState.class);
        if(mouseState!=null){
            mouseState.setIncludeDefaultCollisionRoots(false);
            mouseState.addCollisionRoot(simpleApp.getGuiViewPort());
        }

If you have any suggestions or ideas please message me I may not be able to get back to you right away but I will give it a try!

Lemur’s progress bar (or any UI-level progress bar, really) is going to be EXTREMELY HEAVY for that sort of use-case.

It’s going to create a LOT of objects.

Versus something custom where you might even be able to get it down to one single quad per unit, all batched together into one mesh even.

4 Likes

Okay thanks for the reply。
I don’t understand what you mean by “custom”?
Should I use the most primitive Mesh or the basic components from Lemur?

Lemur is great for UIs.

Lemur is not great for a thousand tiny little indicators. You will need a custom solution.

Custom = you write it yourself from scratch. The code does not exist yet.

2 Likes