Freeform optics can be used in lighting applications to generate accurate prescribed illumination patterns from compact light sources such as LEDs. When targeting dynamic illumination systems, a time-variable optical functionality is needed. Phase-only spatial light modulators (SLMs) have been used in the past for various dynamic beam shaping applications with monochromatic, zero-étendue illumination under paraxial conditions. Such limitations can no longer hold when considering lighting applications. In this paper, a novel algorithm for the calculation of smooth phase shift patterns is presented in order to generate arbitrary target patterns from arbitrary incident wave fronts for non-paraxial conditions. When applying such phase shift patterns to SLMs, these devices can be considered as programmable freeform optics. The experimental performance of the calculated phase patterns is analyzed on a real SLM, with a maximal phase shift of 6π, for collimated laser beams and white LEDs. The possibilities and limitations of generating accurate prescribed target patterns are critically discussed in terms of the angular extent of the target pattern, the consider spectrum of the light source and the étendue of the incident light beam.