Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gap in miter join #3053

Merged
merged 1 commit into from Jul 11, 2023
Merged

Fix gap in miter join #3053

merged 1 commit into from Jul 11, 2023

Conversation

ffreyer
Copy link
Collaborator

@ffreyer ffreyer commented Jul 7, 2023

Description

#2953 introduced a gap in miter joins that I and refimg tests didn't catch:

Screenshot from 2023-07-07 16-37-47
Screenshot from 2023-07-07 16-59-36

The pr fixes that.

To fix anti-aliasing for strongly varying linewidths I added extra AA padding in width direction in #2953. This extra padding is communicated to the fragment shader through and increased linewidth, set in an emit_vertex method. The problem is that this method is also used for the triangle used in miter joins, which does not get any extra AA padding. So there is a missmatch between the real width and the reported width, resulting in the AA edge getting missplaced.

After the changes:

Screenshot from 2023-07-07 17-40-34

Screenshot from 2023-07-07 17-41-55

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Added an entry in NEWS.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.

@ffreyer ffreyer added the GLMakie This relates to GLMakie.jl, the OpenGL backend for Makie. label Jul 7, 2023
@MakieBot
Copy link
Collaborator

MakieBot commented Jul 7, 2023

Compile Times benchmark

Note, that these numbers may fluctuate on the CI servers, so take them with a grain of salt. All benchmark results are based on the mean time and negative percent mean faster than the base branch. Note, that GLMakie + WGLMakie run on an emulated GPU, so the runtime benchmark is much slower. Results are from running:

using_time = @ctime using Backend
# Compile time
create_time = @ctime fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @ctime Makie.colorbuffer(display(fig))
# Runtime
create_time = @benchmark fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @benchmark Makie.colorbuffer(display(fig))
using create display create display
GLMakie 11.64s (11.54, 11.72) 0.07+- 1.05s (1.04, 1.06) 0.01+- 782.19ms (755.29, 832.21) 24.39+- 10.62ms (10.55, 10.69) 0.05+- 88.69ms (88.20, 89.45) 0.52+-
master 11.61s (11.51, 11.78) 0.10+- 1.09s (1.08, 1.10) 0.01+- 773.36ms (769.51, 779.43) 4.04+- 10.82ms (10.68, 10.93) 0.07+- 88.72ms (87.75, 89.61) 0.59+-
evaluation +0.27%, 0.03s invariant (0.38d, 0.49p, 0.08std) -3.50%, -0.04s faster ✓ (-6.05d, 0.00p, 0.01std) +1.13%, 8.82ms invariant (0.50d, 0.38p, 14.21std) -1.90%, -0.2ms faster ✓ (-3.15d, 0.00p, 0.06std) -0.03%, -0.03ms invariant (-0.05d, 0.92p, 0.56std)
CairoMakie 10.12s (10.03, 10.26) 0.08+- 1.25s (1.22, 1.27) 0.02+- 261.27ms (253.53, 265.65) 4.44+- 10.47ms (10.31, 10.68) 0.12+- 6.01ms (5.87, 6.12) 0.11+-
master 10.11s (9.88, 10.31) 0.16+- 1.25s (1.21, 1.32) 0.04+- 261.49ms (250.71, 271.14) 7.22+- 10.46ms (10.12, 10.81) 0.25+- 6.15ms (5.88, 7.14) 0.45+-
evaluation +0.13%, 0.01s invariant (0.11d, 0.85p, 0.12std) -0.50%, -0.01s invariant (-0.21d, 0.70p, 0.03std) -0.08%, -0.22ms invariant (-0.04d, 0.95p, 5.83std) +0.06%, 0.01ms invariant (0.03d, 0.95p, 0.19std) -2.23%, -0.13ms invariant (-0.41d, 0.47p, 0.28std)
WGLMakie 16.28s (15.64, 16.80) 0.42+- 1.74s (1.67, 1.85) 0.07+- 14.70s (14.37, 15.16) 0.25+- 19.23ms (16.93, 23.99) 2.34+- 1.46s (1.42, 1.50) 0.03+-
master 16.11s (15.83, 16.44) 0.23+- 1.70s (1.64, 1.80) 0.05+- 14.86s (14.45, 15.59) 0.36+- 19.76ms (17.85, 21.66) 1.45+- 1.47s (1.44, 1.50) 0.02+-
evaluation +1.03%, 0.17s invariant (0.50d, 0.38p, 0.32std) +2.19%, 0.04s invariant (0.63d, 0.26p, 0.06std) -1.09%, -0.16s invariant (-0.51d, 0.36p, 0.31std) -2.75%, -0.53ms invariant (-0.27d, 0.62p, 1.89std) -0.86%, -0.01s invariant (-0.45d, 0.42p, 0.03std)

@SimonDanisch SimonDanisch merged commit 345a085 into master Jul 11, 2023
14 checks passed
@SimonDanisch SimonDanisch deleted the ff/fix_lines branch July 11, 2023 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GLMakie This relates to GLMakie.jl, the OpenGL backend for Makie.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants