Digital glass forming of photonics