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.setSize(0.2f);
    bmText.setText(this.getActorName());
    bmText.setQueueBucket(RenderQueue.Bucket.Transparent);
    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));
    bmText.setAlignment(BitmapFont.Align.Left);
    bmText.setLineWrapMode(LineWrapMode.NoWrap);

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

    textNode = new Node("Node for text");
    textNode.setQueueBucket(Bucket.Transparent);
    textNode.setLocalTranslation(textLocalTranslationUp);
    textNode.attachChild(bmText);
    bmText.addControl(bbControl);


    this.attachChild(textNode);
}[/java]

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:

http://hub.jmonkeyengine.org/javadoc/com/jme3/renderer/queue/RenderQueue.html

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.

http://hub.jmonkeyengine.org/javadoc/com/jme3/material/RenderState.html

=========================
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.
    DONE!