Simultaneous tailoring of phase evolution and dopant distribution in the glassy phase for controllable luminescence.