using GLMakie,FileIO
activate!(ssao=true)
GLMakie.closeall() # close any open screen
GLMakie.
"""
ssao_init()
# ssao 初始化函数
返回值为:`tuple(fig,ax)`
"""
function ssao_init()
= Figure(resolution = (800, 800))
fig = Makie.SSAO(radius = 5.0, blur = 2)
ssao = LScene(fig[1, 1], scenekw = (ssao=ssao,),show_axis=false)
ax # SSAO attributes are per scene
= 0.025
ax.scene.ssao.bias[] return fig,ax
end
let
=ssao_init()
fig,ax=load("./imgs/golden.png")
material=Rect3f(Vec3f(0), Vec3f(0.5)) # 0.5 是分离的小方块 1是紧凑的聚积在一起
cubic= y = z = 1:10
x = vec([(i, j, k) for i in x, j in y, k in z])
positions
meshscatter!(ax,positions; matcap=material,marker = cubic,markersize = 0.98,ssao=true)
fig
end
SSAO-Rubik
info
using Makie’s SSAO Lighting system