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

Tweak Camera3D clipping #3433

Merged
merged 3 commits into from
Dec 1, 2023
Merged

Tweak Camera3D clipping #3433

merged 3 commits into from
Dec 1, 2023

Conversation

ffreyer
Copy link
Collaborator

@ffreyer ffreyer commented Nov 30, 2023

Description

I noticed that when zooming out you pretty quickly get to a point where the axis gets clipped:

Screenshot from 2023-11-30 13-02-44

The pr tweaks the default clipping behavior a bit to avoid this by scaling far with max(1, view_norm). This makes the frustum grow larger (rather than more or less translating it) when zooming out while keeping far large enough to include the back side of the axis when zooming in. At least with the case I tested, using default camera placement.

cam.mp4

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.

@MakieBot
Copy link
Collaborator

MakieBot commented Nov 30, 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(fig)
using create display create display
GLMakie 3.51s (3.47, 3.57) 0.03+- 398.67ms (386.98, 409.31) 6.94+- 484.46ms (471.81, 527.79) 19.55+- 7.67ms (7.59, 7.80) 0.08+- 25.89ms (25.74, 26.14) 0.15+-
master 3.52s (3.47, 3.56) 0.03+- 407.46ms (398.65, 418.89) 7.87+- 481.40ms (474.00, 488.62) 5.24+- 7.65ms (7.53, 7.88) 0.11+- 25.86ms (25.70, 26.04) 0.11+-
evaluation 1.00x invariant, -0.01s (-0.35d, 0.52p, 0.03std) 1.02x faster ✓, -8.79ms (-1.18d, 0.05p, 7.40std) 0.99x invariant, 3.06ms (0.21d, 0.70p, 12.39std) 1.00x invariant, 0.02ms (0.17d, 0.76p, 0.09std) 1.00x invariant, 0.03ms (0.26d, 0.64p, 0.13std)
CairoMakie 3.06s (3.04, 3.11) 0.02+- 333.67ms (328.10, 337.85) 3.67+- 147.57ms (144.38, 151.00) 2.23+- 7.88ms (7.73, 8.01) 0.09+- 608.78μs (606.58, 610.69) 1.47+-
master 3.04s (3.01, 3.06) 0.02+- 332.02ms (320.63, 345.89) 8.74+- 147.02ms (144.29, 151.30) 2.87+- 7.88ms (7.70, 7.97) 0.09+- 609.01μs (603.44, 614.16) 4.24+-
evaluation 0.99x invariant, 0.02s (0.74d, 0.19p, 0.02std) 1.00x invariant, 1.64ms (0.25d, 0.66p, 6.21std) 1.00x invariant, 0.55ms (0.21d, 0.70p, 2.55std) 1.00x invariant, -0.0ms (-0.00d, 0.99p, 0.09std) 1.00x invariant, -0.22μs (-0.07d, 0.90p, 2.86std)
WGLMakie 3.70s (3.64, 3.82) 0.06+- 336.67ms (327.03, 348.02) 9.45+- 8.87s (8.70, 9.22) 0.23+- 9.79ms (9.43, 10.41) 0.34+- 73.93ms (68.00, 80.88) 4.97+-
master 3.70s (3.66, 3.75) 0.04+- 323.67ms (318.99, 331.63) 4.10+- 8.81s (8.63, 8.98) 0.14+- 9.50ms (9.35, 9.74) 0.15+- 73.18ms (67.05, 81.68) 5.97+-
evaluation 1.00x invariant, 0.0s (0.04d, 0.94p, 0.05std) 0.96x slower X, 13.0ms (1.78d, 0.01p, 6.78std) 0.99x invariant, 0.06s (0.32d, 0.56p, 0.18std) 0.97x invariant, 0.29ms (1.14d, 0.07p, 0.24std) 0.99x invariant, 0.74ms (0.14d, 0.80p, 5.47std)

@SimonDanisch SimonDanisch merged commit 0919de0 into master Dec 1, 2023
15 checks passed
@SimonDanisch SimonDanisch deleted the ff/camera branch December 1, 2023 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants