-
-
Notifications
You must be signed in to change notification settings - Fork 328
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
interpolate between values instead of interpolating between colors #2097
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))
|
Cairo can't do any other interpolation than between color. So to really support it we would need to software-render our own meshes to bitmaps directly. |
Yeah, I've been wanting to do that... It's not even that hard, just need to find some time for it! |
Hmm...wouldn't that essentially lose the "vector" nature of the mesh (i.e., zoomability without pixelation)? Or are you proposing subdividing the mesh and interpolating along color gradients of smaller magnitude? Either way, it would probably be nice to be able to turn it on and off by some switch in CairoMakie. Also, how would this affect large meshes like those generated by |
Mesh is already rasterized (at least in svgs). Could be that it's not in pdfs, not sure, but the mesh operator hasnt been added to the svg spec yet. |
Hmm, makes sense. I believe PDF does have a mesh gradient intrinsic, but in any case that would be a fixed color interpolation type. Would you be going along a route similar to this, or something else? Edit: if we're doing this we could theoretically also allow the user to specify the mode of interpolation (linear, cubic, bilinear, etc) |
@@ -8,6 +8,7 @@ role as `datalimits` in `violin` [#2137](https://github.com/JuliaPlots/Makie.jl/ | |||
- Improve performance around Axis(3) limits [#2115](https://github.com/JuliaPlots/Makie.jl/pull/2115). | |||
- Cleanup stroke artifacts in scatter and text [#2096](https://github.com/JuliaPlots/Makie.jl/pull/2096). | |||
- compile time improvements [#2153](https://github.com/JuliaPlots/Makie.jl/pull/2153). | |||
- interpolate between values instead of interpolating between colors for WGLMakie + GLMakie [#2097](https://github.com/JuliaPlots/Makie.jl/pull/2097) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalization here and above :)
It's not that good to paste the PR titles as those are usually not even complete sentences.
We've been interpolating between colors in the mesh shader...
TODO: We also still interpolate between colors in cairo at least for mesh.
Bug report: https://discourse.julialang.org/t/how-to-create-a-patch-shape-with-a-color-gradient-in-a-simple-2d-plot/62607/7?u=sdanisch
Before:
With this PR:
