From 7305ee2136b2b72d081f7850804d563fa8cde4b8 Mon Sep 17 00:00:00 2001 From: Jacob Frank Date: Fri, 15 Jan 2016 22:07:02 -0800 Subject: [PATCH] WIP #12: enable anti-aliasing --- .../artemis/engconsole/ui/damcon/Damcon.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/com/brindyblitz/artemis/engconsole/ui/damcon/Damcon.java b/src/com/brindyblitz/artemis/engconsole/ui/damcon/Damcon.java index 0d2454d..d618992 100644 --- a/src/com/brindyblitz/artemis/engconsole/ui/damcon/Damcon.java +++ b/src/com/brindyblitz/artemis/engconsole/ui/damcon/Damcon.java @@ -146,18 +146,26 @@ private static void wireframeifyScene(Scene scene) { private static Appearance getWireframeAppearance() { Appearance appearance = new Appearance(); + // Set transparency TransparencyAttributes transparency = new TransparencyAttributes(TransparencyAttributes.BLENDED, .75f); appearance.setTransparencyAttributes(transparency); + // Enable automatic anti-aliasing + LineAttributes la = new LineAttributes(); + la.setLineAntialiasingEnable(true); + appearance.setLineAttributes(la); + + // Set color Color awtColor = WIREFRAME_COLOR; Color3f color = new Color3f(awtColor); ColoringAttributes ca = new ColoringAttributes(); ca.setColor(color); appearance.setColoringAttributes(ca); + // Make wireframe PolygonAttributes pa = new PolygonAttributes(); pa.setPolygonMode(pa.POLYGON_LINE); - pa.setCullFace(pa.CULL_NONE); + pa.setCullFace(pa.CULL_NONE); // allow triangles with normals facing away from the camera to render appearance.setPolygonAttributes(pa); return appearance;