Controling the shadows in 3D Makie visualizations

I am new to 3D visualization, and wonder how people usually control the “shadows”. When I visualize the grid below the colors are too dark as if the light source was behind the cube by default:

image

Is there a recommended set of defaults to make the colors look more vivid?

The light source is the camera by default. If a mesh isn’t lit it means you either don’t have normals or they point in the wrong/opposite direction. You can turn off lighting all together with shading = false or correct the normals to fix this.

1 Like

I usually just play with.
ambient = Vec3f0(0.85, 0.85, 0.85), backlight = 1f0

3 Likes

@ffreyer I am using the meshscatter you shared in an issue to plot this grid as a collection of boxes in the 3D case. Is there any simple fix to the meshscatter call? I thought the defaults would be more vivid in terms of normals.

Thanks @lazarusA I will try to play with these parameters.

Something like

m = Rect3D(Point3f0(-0.5), Vec3f0(1))
fig, ax, p = meshscatter([Point3f0(i,j,k) for i in 1:5 for j in 1:5 for k in 1:5], marker=m, color=rand(125), markersize=1)

shouldn’t have shading issues. It’s working fine for me with GLMakie 0.3.4

Maybe this issue is specific to WGLMakie? I’ve noticed some differences from GLMakie.

Oh this could be :frowning: I can’t wait to have them share the same shaders, so that they’re 100% equivalent…