Commit 8dcb2575 authored by Matthias Betz's avatar Matthias Betz
Browse files

Make highlight edges win depth ties so they show in wireframe



Highlight edges share the exact depth of the wireframe mesh lines, so GL_LESS
rejected them and they vanished in wireframe mode. Draw the overlay with
GL_LEQUAL (restored to GL_LESS afterward) so coincident markers draw on top
while still being occluded by nearer geometry.

Co-Authored-By: default avatarClaude Opus 4.8 <noreply@anthropic.com>
parent 716ad63a
...@@ -198,6 +198,9 @@ public class GLViewport { ...@@ -198,6 +198,9 @@ public class GLViewport {
scene.draw(gl); scene.draw(gl);
// wireframe applies to the geometry only; highlight markers always render filled // wireframe applies to the geometry only; highlight markers always render filled
gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL3.GL_FILL); gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL3.GL_FILL);
// highlight markers sit at the same depth as geometry edges (and the wireframe lines); use
// LEQUAL so the later-drawn markers win depth ties instead of being rejected by GL_LESS
gl.glDepthFunc(GL.GL_LEQUAL);
// edge markers reuse the flat scene program (pos + colour) // edge markers reuse the flat scene program (pos + colour)
overlay.drawLines(gl, lineScale); overlay.drawLines(gl, lineScale);
// vertex markers use the sphere-impostor program (geometry shader -> camera-facing quads) // vertex markers use the sphere-impostor program (geometry shader -> camera-facing quads)
...@@ -206,6 +209,7 @@ public class GLViewport { ...@@ -206,6 +209,7 @@ public class GLViewport {
gl.glUniform2f(pointProgram.uniform(gl, "uViewport"), (float) w, (float) h); gl.glUniform2f(pointProgram.uniform(gl, "uViewport"), (float) w, (float) h);
gl.glUniform1f(pointProgram.uniform(gl, "uPointSize"), pointScale); gl.glUniform1f(pointProgram.uniform(gl, "uPointSize"), pointScale);
overlay.drawPoints(gl); overlay.drawPoints(gl);
gl.glDepthFunc(GL.GL_LESS); // restore for the next frame's scene pass
double[] req = pickRequest; double[] req = pickRequest;
if (req != null && currentScene != null) { if (req != null && currentScene != null) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment