CartoonEdgeFilter shades BitmapText - how to stop that?

I’ve the CartoonEdgeFilter working fine…



[java]

FilterPostProcessor fpp = new FilterPostProcessor(assetManager);

CartoonEdgeFilter cf = new CartoonEdgeFilter();

cf.setDepthThreshold(0f);

cf.setDepthSensitivity(1000);

fpp.addFilter(cf);

viewPort.addProcessor(fpp);

[/java]



… but I have some BitmapText in my scene, and the shader draws edges around the bounding box of each character. How do I tell it to not do that?!

Put the text in another viewport

So, would I create a post view for something like that? The camera would just be the same as the main camera?



[java]

cam.setLocation(new Vector3f(0, 0, 50));

cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);

cam.setFrustumFar(250f);



Camera camText = cam.clone();

camText.setLocation(new Vector3f(0, 0, 50));

camText.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);

camText.setFrustumFar(250f);



mTextView = renderManager.createPostView("Text view", camText);

mTextView.attachScene(rootNode);







BitmapFont font = getAssetManager().loadFont("Interface/Fonts/Default.fnt");

BitmapText text = new BitmapText(font, false);

text.setSize(1f);

text.setColor(ColorRGBA.Black);

text.setText("Some text here…");

text.setQueueBucket(Bucket.Transparent);

text.updateGeometricState();

mTextView.attachScene(text);



[/java]

Yeah that should work.

It is still not clear to me what I should do here. The above just creates two views that overlap each other (I can move the main one with the mouse). But the text doesn’t show up at all.

If they overlap, you might need to disable clearing on the second one (setClearFlags(false))

This is the only function along those lines:



public void setClearFlags(boolean color, boolean depth, boolean stencil);



Is that the one you mean?

Yes … Did you try it?