-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
Try to fix marker size #3073
Try to fix marker size #3073
Conversation
Compile Times benchmarkNote, 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))
|
Yea that's kind of what I expected. You probably want even dividers for of the pixelsize for the aspect ratio. Maybe we can clean up the rounding error at the other end when we calculate markersize and offset? |
I tried counteracting the distortion from rounding to full pixels by scaling |
I don't understand what I did yet but I think I got it working... |
I reformulated/simplified the math here and added a comment that explains what's happening. I think this should be good to merge now. (Checked the two tests from above and a triangle with large offset) |
I think the reason for the scaling factor being so large (0.018 rather than 1/256 = 0.0039 or even 1/64 = 0.015625) is that the integer rounding errors compound during downsampling. So I made another change that effectively adds padding to avoid this. I don't really see things moving though, it just removes a bit of blur on hline (compared to last commit) or vline (compared to refimgs). RefimgNo pixelsize matching (before commit)With pixelsize matching (after commit) |
Oh yea, latest commit will need a texture atlas update |
Thanks, looks good! :) |
#2990 introduced a problem in the exact marker size: