Beam shaping and control with nonlinear optics