[ANN] VolumeRendering.jl – plotting volumes, fast and interactive

Happy to announce a new package VolumeRendering.jl for visualizing 3D fields – scalar or vector, always fast, interactive, and extensible.

Just registered in General!

The default recommended way to use it is as an ImGui widget, can potentially be integrated into other environments if needed.

Simplest example

using VolumeRendering, AxisKeys

# your data: any 3D `KeyedArray` whose axis keys give the world coordinates
A = KeyedArray(...; x = xs, y = ys, z = zs)

view = FieldView(A)

# ...then, inside your ImGui frame:
ShowField(view)

Result (the small UI popup is automatic):

More advanced

VolumeRendering is used in PlasmaScope.jl to display 3D fields from GRMHD simulations. See that app for how to add simple geometry objects, slices into the field, and for arbitrary (non-rectangular) grid support.

Should be broadly applicable and performant in basically any regime!

Very cool! I’m curious though, can you get these sorts of 3d plots with GLMakie?

I played around with it in Slate to see what I could accomplish in a short time today. Mainly to see if integrating it would work, given it’s designed to work primarily with the CImGui.jl framework.

Amazing!
I was planning on building an imGui UI at work for sound field visualizations. I guess I don’t have any more excuses now…

Makie does have some volumetric plots, but they are fundamentally much more limited as far as I understand – eg, they require materialized rectangular axis-aligned grid, and are generally slower. Here, I make sure even large-ish fields/high rendering resolutions remain interactive.

And the main fundamental difference is the “level” of interactivity. After discovering imgui recently, I came to using Makie less and less – really, only use it for static high-quality plots, and for simple animations of those. I always found it hard to build truly dynamic interfaces in Makie, even basic things like completely different sets of controls/plot depending on a selection, or these popup windows, etc. And now I know a more straightforward way :slight_smile: As a welcome side-effect, one also gets much smaller TTFX than Makie.

I’m wondering, how far are we from trimmable imGui applications? Have you tried already for this one?

I cannot install for Julia 1.10.11 and windows 11:

 (jl_LS4j5v) pkg> add https://github.com/JuliaAPlavin/VolumeRendering.jl
     Cloning git-repo `https://github.com/JuliaAPlavin/VolumeRendering.jl`
    Updating git-repo `https://github.com/JuliaAPlavin/VolumeRendering.jl`
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package ImPlotExtra [bf2a09a8]:
 ImPlotExtra [bf2a09a8] log:
 ├─ImPlotExtra [bf2a09a8] has no known versions!
 └─restricted to versions 0.1 by VolumeRendering [16f7ad8c] — no versions left
   └─VolumeRendering [16f7ad8c] log:
     ├─possible versions are: 0.1.0 or uninstalled
     └─VolumeRendering [16f7ad8c] is fixed to version 0.1.0

I personally haven’t explored trim in julia at all – but happy to hear others’ experiences!

Sorry, the latest commit uses the interactive colorbar from ImPlotExtra – another package of mine that I intend to register soon. Use the version of VolumeRendering.jl registered in General, ie ]add VolumeRendering.

Yeah sometimes I wish we could fully redesign Makie from the ground up :slight_smile: It’s grown pretty organically and with a different focus at different times, so imgui can be much nicer to use for these crammed GUIs with lots of options, popups, etc. TTFX is not primarily our fault I’d say but of course it matters a lot for interactive use cases. In terms of these interfaces where you have completely different sets of controls in different sections, probably this work will help All the new GUI features combined - Pull Request #5702 - MakieOrg/Makie.jl - GitHub