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

add interpolate option to volume #3485

Merged
merged 2 commits into from Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions GLMakie/src/drawing_primitives.jl
Expand Up @@ -802,11 +802,14 @@ function draw_atomic(screen::Screen, scene::Scene, plot::Volume)
)
return convert(Mat4f, m) * m2
end
interp = to_value(pop!(gl_attributes, :interpolate))
interp = interp ? :linear : :nearest
Tex(x) = Texture(x; minfilter=interp)
if haskey(gl_attributes, :intensity)
intensity = pop!(gl_attributes, :intensity)
return draw_volume(screen, intensity, gl_attributes)
return draw_volume(screen, Tex(intensity), gl_attributes)
else
return draw_volume(screen, plot[4], gl_attributes)
return draw_volume(screen, Tex(plot[4]), gl_attributes)
end
end
end
3 changes: 2 additions & 1 deletion MakieCore/src/basic_plots.jl
Expand Up @@ -192,6 +192,7 @@ Available algorithms are:
- `algorithm::Union{Symbol, RaymarchAlgorithm} = :mip` sets the volume algorithm that is used.
- `isorange::Real = 0.05` sets the range of values picked up by the IsoValue algorithm.
- `isovalue = 0.5` sets the target value for the IsoValue algorithm.
- `interpolate::Bool = true` sets whether the volume data should be sampled with interpolation.

$(Base.Docs.doc(shading_attributes!))

Expand All @@ -205,7 +206,7 @@ $(Base.Docs.doc(MakieCore.generic_plot_attributes!))
algorithm = :mip,
isovalue = 0.5,
isorange = 0.05,

interpolate = true,
fxaa = true,
)
generic_plot_attributes!(attr)
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Expand Up @@ -4,6 +4,7 @@

- DataInspector Fixes: Fixed depth order, positional labels being in transformed space and `:inspector_clear` not getting called when moving from one plot to another. [#3454](https://github.com/MakieOrg/Makie.jl/pull/3454)
- Fixed bug in GLMakie where the update from a (i, j) sized GPU buffer to a (j, i) sized buffer would fail [#3456](https://github.com/MakieOrg/Makie.jl/pull/3456).
- Add `interpolate=true` to `volume(...)`, allowing to disable interpolation [#3485](https://github.com/MakieOrg/Makie.jl/pull/3485).

## 0.20.2

Expand Down