A spatial light modulator is really just a specially designed display.
Each pixel can be set to a Opaque/Transparent state, and this allows generation of custom diffraction gratings in software and using them right away without the hassles of lithography.
In order to build this, I dismantled a cheap projector along with a labmate, and proceeded to test its performance.
A laser beam was first diverged and collimated to take up the width of the display to achieve maximum resolution. It was then re-converged, and various difraction patterns were tried out.