Emulating gravity with linear and nonlinear optical settings