Skip to content

Commit

Permalink
Changed order of renderables to support transperency
Browse files Browse the repository at this point in the history
  • Loading branch information
breiler committed Nov 29, 2024
1 parent d9bfb2e commit 6d9e260
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class Grid extends VertexObjectRenderable {
private float[] zAxisColor;

public Grid(String title) {
super(6, title, VISUALIZER_OPTION_GRID, new PlainShader());
super(10, title, VISUALIZER_OPTION_GRID, new PlainShader());
reloadPreferences(new VisualizerOptions());
}

Expand All @@ -59,7 +59,6 @@ public final void reloadPreferences(VisualizerOptions vo) {
public void render(GLAutoDrawable drawable) {
GL2 gl = drawable.getGL().getGL2();
gl.glLineWidth(1.2f);
gl.glDisable(GL.GL_DEPTH_TEST);
gl.glDrawArrays(GL.GL_LINES, 0, getVertexCount());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public void reloadPreferences(VisualizerOptions vo) {
@Override
public void render(GLAutoDrawable drawable) {
GL2 gl = drawable.getGL().getGL2();
gl.glDisable(GL.GL_DEPTH_TEST);
gl.glDrawArrays(GL.GL_TRIANGLES, 0, getVertexCount());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class SizeDisplay extends Renderable implements UGSEventListener {
private boolean textRendererDirty = true;

public SizeDisplay(String title) {
super(3, title, VISUALIZER_OPTION_SIZE_DISPLAY);
super(8, title, VISUALIZER_OPTION_SIZE_DISPLAY);
reloadPreferences(new VisualizerOptions());
backend = CentralLookup.getDefault().lookup(BackendAPI.class);
units = backend.getSettings().getPreferredUnits();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ This file is part of Universal Gcode Sender (UGS).
*/
package com.willwinder.ugs.nbm.visualizer.renderables;

import com.jogamp.opengl.GL;
import com.jogamp.opengl.GL2;
import com.jogamp.opengl.GLAutoDrawable;
import com.jogamp.opengl.glu.GLU;
Expand All @@ -42,7 +41,7 @@ public final class Tool extends Renderable {
Color toolColor;

public Tool(String title) {
super(4, title, VISUALIZER_OPTION_TOOL);
super(11, title, VISUALIZER_OPTION_TOOL);
reloadPreferences(new VisualizerOptions());
}

Expand Down Expand Up @@ -76,8 +75,6 @@ public void draw(GLAutoDrawable drawable, boolean idle, Position machineCoord, P

double scale = 1. / scaleFactor;
gl.glPushMatrix();
gl.glEnable(GL.GL_DEPTH_TEST);

gl.glTranslated(position.x, position.y, position.z);
gl.glScaled(scale, scale, scale);

Expand Down

0 comments on commit 6d9e260

Please sign in to comment.