Makie arrow through transparent mesh

How can I draw arrows through semi-transparent objects with Makie? I can’t get the line to show properly through the transparent surface.

Here’s a minimal example:

using GLMakie

scene = Scene(resolution = (800, 600), limits = FRect((0, 0, 0), (3, 3, 3)))

arrows!(scene, [Point3f0(0)], [Vec3f0(1.5)], linewidth=5)

shape = FRect((0, 0, 0), (2, 2, 2))
color = RGBAf0(.2, .8, .2, .4)

mesh!(scene, shape; color, transparency=true)

cameracontrols(scene).eyeposition[] = Point3f0(1, 4, 2)
scene

The arrow head behaves as expected, but the arrow line is unaffected by the transparent object:

I tried the fxaa=true trick from Makie - drawing lines through transparent surface - #2 by sdanisch without success…

As things are atm attributes need to be passed to primitive plots explicitly when writing a recipe. That’s not always done thoroughly. In this case adding fxaa = true in the Arrows call is simply ignored. You can manually adjust that by going to the relevant primitive, e.g.

ap = arrows!(...)
ap.plots[1].fxaa[] = true
4 Likes