diff --git a/CHANGELOG.md b/CHANGELOG.md index f3f2a2eac83..70dbc9bc948 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [Unreleased] +- Fixed the broken OpenGL state cleanup for clip_planes which may cause plots to disappear randomly [#4157](https://github.com/MakieOrg/Makie.jl/pull/4157) - Reduce updates for image/heatmap, improving performance [#4130](https://github.com/MakieOrg/Makie.jl/pull/4130). ## [0.21.7] - 2024-08-19 diff --git a/GLMakie/src/GLAbstraction/GLRender.jl b/GLMakie/src/GLAbstraction/GLRender.jl index b1dbeb967d4..146eeb6dd44 100644 --- a/GLMakie/src/GLAbstraction/GLRender.jl +++ b/GLMakie/src/GLAbstraction/GLRender.jl @@ -10,10 +10,9 @@ function setup_clip_planes(robj) for i in 0:min(7, N-1) glEnable(GL_CLIP_DISTANCE0 + UInt32(i)) end - # TODO: This crashes? - # for i in N:7 - # glDisable(GL_CLIP_DISTANCE0 + UInt32(i)) - # end + for i in max(0, N):7 + glDisable(GL_CLIP_DISTANCE0 + UInt32(i)) + end end diff --git a/MakieCore/src/basic_plots.jl b/MakieCore/src/basic_plots.jl index de7004c8ff4..135443248ce 100644 --- a/MakieCore/src/basic_plots.jl +++ b/MakieCore/src/basic_plots.jl @@ -77,7 +77,11 @@ function mixin_generic_plot_attributes() inspector_clear = automatic "Sets a callback function `(inspector, plot, index) -> ...` which replaces the default `show_data` methods." inspector_hover = automatic - "TODO: docs" + """ + Clip planes offer a way to do clipping in 3D space. You can set a Vector of up to 8 `Plane3f` planes here, + behind which plots will be clipped (i.e. become invisible). By default clip planes are inherited from the + parent plot or scene. You can remove parent `clip_planes` by passing `Plane3f[]`. + """ clip_planes = automatic end end diff --git a/docs/makedocs.jl b/docs/makedocs.jl index 03cf85c6043..665aa07f9a1 100644 --- a/docs/makedocs.jl +++ b/docs/makedocs.jl @@ -141,6 +141,7 @@ pages = [ "reference/scene/lighting.md", "reference/scene/matcap.md", "reference/scene/SSAO.md", + "reference/scene/clip_planes.md", ] ], "Tutorials" => [