GLMakie Box(f[1,1]) hides Axis3 content

I’m using the Box function with different colours to differentiate between panels in my figure.

The issue I’m having is that the Box hides the Axis3 lines and the axis contents. Is there a known way around this? I do remember reading somewhere in the docs that GLMakie has issues with transparency, but I’m not sure if that relates to this specific problem as the Axis is fine and the Axis3 is not.

CairoMakie output:
image

GLMakie output:
image

Code used:

    f = Figure()

    Box(f[1,1],color = (:red, 0.1))
    ax = Axis(f[1,1],alignmode=Outside())
    scatter!(ax,rand(100),rand(100))

    Box(f[1,2],color = (:blue, 0.1))
    ax = Axis3(f[1,2],alignmode=Outside())
    scatter!(ax,rand(100),rand(100),rand(100))

    f

Try it with backwards translation like shown here How to draw boxes around subfigures · Makie

GLMakie has a zbuffer while CairoMakie draws things sequentially, that’s where the difference stems from.

That doesn’t seem to work for this. Here is the example from that webpage with one of the Axis changed to an Axis3, using GLMakie:

image

edit: and just to clarify, I did this for my specific example which didn’t seem to work:

begin
    f = Figure()
    
    box1=Box(f[1,1],color = (:red, 0.1))
    box2=Box(f[1,2],color = (:blue, 0.2))

    #added these lines:
    translate!(box1.blockscene,0,0,-100)
    translate!(box2.blockscene,0,0,-100)
    
    ax = Axis(f[1,1],alignmode=Outside(),backgroundcolor = (:blue, 0.2))
    scatter!(ax,rand(100),rand(100))

    ax = Axis3(f[1,2],alignmode=Outside(),backgroundcolor = (:blue, 0.2))
    scatter!(ax,rand(100),rand(100),rand(100))

    f
end

What if you make the translation -5000 or -10000?

That helped, thanks very much. It seems like the 2D Axis and 3D Axis panels start to go in front of the box at different numbers, which is interesting

With -10000:
image

and -50000:
image

hm weird but at -50000 the boxes aren’t rendered at all anymore. There’s a limit to how far back you can go, I thought it was -10,000. It’s because in OpenGL rendering there’s a near and far value outside of which nothing is rendered.