A method for shaping an output light beam from an optical fiber by controlling the phase and amplitude of the beam by producing beam shaping elements on an exit facet of the optical fiber by direct surface texturing of the exit facet, where a controlled phase difference is achieved across the fiber cross-section over a predefined pattern. The optical fiber can be a single mode fiber or a multi-mode fiber. Either a binary or a complex phase difference can be achieved. Also disclosed is the related system for shaping an output light beam from an optical fiber.