Billboard above npcs

I currently have the names of the NPCs displayed above their heads. I also use the cartoonedgefilter and because of this, I get this effect:

[java]As you can see the edge is also applied on the billboard. I currently create the billboards as folows:

public void createBillboard(AssetManager manager) {
    // Load font and create the Text
    BitmapFont font = manager.loadFont("fonts/comicbook.fnt");

    BitmapText bmText = new BitmapText(font);
    bmText.setColor(new ColorRGBA(241f / 255f, 30f / 255f, 34f / 255f, 1f));
    bmText.setBox(new Rectangle(-bmText.getLineWidth() / 2.0f - 0.2f, 0, bmText.getLineWidth() * 2.0f, bmText.getLineHeight() + 0.1f));

    // Create node and add a BillboardControl so it rotates with the cam
    BillboardControl bbControl = new BillboardControl();

    textNode = new Node("Node for text");


Is there a way of doing this so that the edge of the cartoonedgefilter is not displaying ? I tried putting it in the translucent bucket but then the names will appear above every other object which is not natural.

Did you understand the way how and when Bucket / GeometryComparator/ SceneProcessor affect the rendering and order of geometry? I guess not very clear, so here is it:

This can be consider a mini bucket if you set attributes in associated Material right (very limited application). For ex: You want to render the terrain first, then all your characters, then all they healthbar. First, you have to somehow partition terrain geometry, characters geometry and healthbar geometry into continous section in the GeometryList. Then youhave to find a good combination of Material.getAdditionalRenderState().setDepthTest() for them to appear correctly.

Second, in your code i see you attach the HUD as a child of your node and may be you later apply the CartoonEdge in that main node.
The way CartoonEdge work, as far as i remember is to render the whole node into another buffer then celshading and border it. So I recommend you to change the nested order:

  • Put your player node into a dummyNode.
  • Put the HUD Billboard into the same dummyNode.
  • Apply CartoonEdge to playNode.
  • Move the entire dummyNode.