A structured light projector for generating a far-field image of light dots in a defined pattern is proposed, where the structured light projector includes a light source providing as an output a non-collimated light beam and a specialized diffractive optical element disposed to intercept the non-collimated light beam. The specialized diffractive optical element is formed to exhibit a non-uniform pattern of grating features configured to compensate for the non-planar wavefront and phase retardation of the non-collimated output beam, providing as an output of the projector an interference pattern of light dots exhibiting the desired configuration.