A structured light projector comprising: a light source emitting light of a first wavelength; at least one switchable grating switchable between a non-diffracting and a diffracting state; and at least one passive grating. At least one of the switchable and passive gratings provides a first grating configuration for projecting uniform illumination in a first interval of time. At least one of the switchable and passive gratings provides a second grating configuration for projecting structured illumination in a second interval of time. |