An optical waveguide comprises at least two TIR surface and contains a grating. Input TIR light with a first angular range along a first propagation direction undergoes at least two diffractions at the grating. Each diffraction directs light into a unique TIR angular range along a second propagation direction.