Skip to content

Commit

Permalink
fix pixel skipping?
Browse files Browse the repository at this point in the history
  • Loading branch information
ffreyer committed Feb 8, 2024
1 parent 8dd7a0a commit 634a940
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion GLMakie/assets/shader/lines.geom
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ void main(void)
// float precision issues with joint discards. (I.e. what makes this segment discards
// pixels drawn by the previous/next segment.) Higher values reduce jitter but probably
// increase risk of creating overlap/gaps
vertex.position = vec3[2](p1, p2)[x] + 0.0078125 * round(128.0 * (v_offset * v1 + n_offset * vec3(n1, 0)));
vertex.position = 0.03125 * round(32.0 * (vec3[2](p1, p2)[x] + v_offset * v1 + n_offset * vec3(n1, 0)));

// Generate SDF's

Expand Down
2 changes: 1 addition & 1 deletion WGLMakie/src/Lines.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ function lines_vertex_shader(uniforms, attributes, is_linesegments) {
// round seems to fix overdraw/underdraw but introduces slight jitter
// round(f * ...) / f reduces jitter but may reintroduce over/underdraw
vec3 point = 0.5 * (p1 + p2) + 0.125 * round(8.0 * (v_offset * v1 + n_offset * vec3(n1, 0)));
vec3 point = 0.125 * round(8.0 * (0.5 * (p1 + p2) + v_offset * v1 + n_offset * vec3(n1, 0)));
// SDF's
Expand Down
4 changes: 2 additions & 2 deletions WGLMakie/src/wglmakie.bundled.js
Original file line number Diff line number Diff line change
Expand Up @@ -21827,8 +21827,8 @@ function lines_vertex_shader(uniforms, attributes, is_linesegments) {

// round seems to fix overdraw/underdraw but introduces slight jitter
// round(f * ...) / f reduces jitter but may reintroduce over/underdraw
vec3 point = 0.5 * (p1 + p2) + 0.125 * round(8.0 * (v_offset * v1 + n_offset * vec3(n1, 0)));
// vec3 point = 0.5 * (p1 + p2) + round((v_offset * v1 + n_offset * vec3(n1, 0)));
// vec3 point = 0.5 * (p1 + p2) + 0.125 * round(8.0 * (v_offset * v1 + n_offset * vec3(n1, 0)));
vec3 point = 0.125 * round(8.0 * (0.5 * (p1 + p2) + v_offset * v1 + n_offset * vec3(n1, 0)));


// SDF's
Expand Down

0 comments on commit 634a940

Please sign in to comment.