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

Highclip and lowclip seem not to work with volume #4850

Open
Luluser opened this issue Mar 6, 2025 · 1 comment
Open

Highclip and lowclip seem not to work with volume #4850

Luluser opened this issue Mar 6, 2025 · 1 comment
Labels

Comments

@Luluser
Copy link

Luluser commented Mar 6, 2025

Highclip and lowclip are not taken into account with volume recipes ?

vol = [cos(X) * sin(Y) * sin(Z) * T for X ∈ LinRange(0, π, 50), Y ∈ LinRange(0, 2π, 100), Z ∈ LinRange(0, 3π, 150)]
minmax = minimum(vol)*1.1, maximum(vol)*0.9
f= Figure()
ax= LScene(f[1,1])
plt = volume!(ax, vol, colorrange = minmax, colormap = :coolwarm, lowclip=:transparent, highclip=:black)
cb = Colorbar(f[1, 2], plt)

Give the proper colorbar but a plot ignoring the outside values

  • Makie v0.21.13
  • works with a fresh environment
  • Ubuntu 22.04.5 LTS, Mesa Intel® Graphics (RPL-P)
@Luluser Luluser added the bug label Mar 6, 2025
@jmert
Copy link
Contributor

jmert commented Mar 20, 2025

I came across a use case where I wanted to use lowclip to make features in a volume plot more visible. Making a few changes to the GLMakie fragment shaders and the following test case,

Plotting code
using GLMakie

xx = range(-π, π, 300)
vol = [cos(x) * sin(y) * sin(z) for x in xx, y in xx, z in xx]
kws = (;
       colormap = :viridis,
       colorrange = (0.1, 0.9),
       lowclip = :transparent,
       highclip = :black,
      )

fig = Figure(size = (800, 600))

algorithms = (:mip, :absorption, :absorptionrgba, :additive)
for (ii, alg) in enumerate(algorithms)
    I = Tuple(CartesianIndices((2, 2))[ii])
    ax = Axis3(fig[I...], title = "algorithm = $(repr(alg))", aspect = :equal)
    volume!(ax, vol; algorithm = alg, kws...)
end

I can turn the first image into the second image.

Before
Image

After
Image

Going through this exercise, though, I realize it's not 100% clear to me what the interpretation of lowclip and highclip even are given the different algorithm options. If my (hacked) code changes are useful to further progress, I'd be happy to share/make a draft PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants