Makie: animation becomes slow after redrawing surface about 25 times

Thanks @jules! You got it 100%. I assumed

glacier = Makie.surface!(scene, X, Y, H_v)

would give back a handle for the surface, not for the scene. So, I applied your first suggestion with Observables and got

#(...) 
HB_v = fill(NaN, nx, ny)
HB_vn = Node(HB_v)
scene = Makie.surface(0:dx:lx, 0:dy:ly, transpose(B_v), colormap = cgrad(:terrain, scale=:exp10))
Makie.surface!(scene, X, Y, HB_vn, colormap=ice_color, shininess=Float32(2^10), transparency=true, shading=true)

record(scene, "glacierflow.gif"; framerate = 25) do io
    for it = 1:nt
        #(...) 
        HB_v .= transpose(B_v.+H_v)
        HB_vn[] = HB_v
        recordframe!(io)
        #(...) 
    end
end

This works, but now, I have still one little doubt: I am not familiar with the syntax data[], i.e. what does that exactly do?

Then, here you see my first little thing done with Makie:

It’s very cartoon-like :slight_smile: What is not bad as it is a purely synthetic setup, but I would very much appreciate any ideas to improve it! The colors are certainly something to change…

Thanks!!

5 Likes