-
-
Notifications
You must be signed in to change notification settings - Fork 311
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
Add clipping options to GLMakie #2783
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))
|
I tried two options for lines - one uploading two buffers, one with world space positions and one with screen space positions; and one that only uploads world space positions, i.e. lets the screen space positions calculated for last_len go to waste. In the end they both perform about equal for me, but the latter saves some memory which I assume is valuable for some. It's also a bit less code, so that's what I went with. |
https://stackoverflow.com/questions/22628186/glclipplane-is-there-an-equivalent-in-webgl |
we also need polygons for clipping, for example for nonlinear axes. is that something that would fit the scope of this pr or not at all? |
Short summary of how this works: If you have a complex polygon or mesh to check against you'll need lots of clip planes, and you can only pass so many If the clipping shapes are 2D you can also go through stencil buffers. Conceptually it shouldn't be too difficult to render an arbitrary poylgon to the stencil buffer and then use that as a mask for clipping. In practice our renderloop needs to be more adjustable for this, I think. |
Yes this would have to be the mechanism for weird axis shapes, I think. |
Closing this in favor of #3958 |
Description
This adds the option to specify a world space clipping box which excludes anything outside it from rendering.
Currently this is a per-plot attribute that defaults to what the scene defines. Can be
nothing
, aRect3
orWorldAxisLimits
.Working so far
lines, linesegements, scatter and text may need to work differently since they transform to along the way.
Type of change
Checklist