Process for coatings or optical elements