Ion beam energy attenuation for fabrication of buried, variable-depth, optical waveguides