Skip to content

Commit

Permalink
WIP #12: enable anti-aliasing
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobmaxfrank committed Jan 16, 2016
1 parent db9ee0e commit 7305ee2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/com/brindyblitz/artemis/engconsole/ui/damcon/Damcon.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7305ee2

Please sign in to comment.