Background

White objects

Light shadow casting

Light rendering

Light rendering with shadows

globalCompositeOperation="destination-out" is used for removing shadow parts.

Dark mask

Result