In this work, the role of the nitrogen content, the annealing temperature, and the sample morphology on the luminescence properties of Ce3+ and Tb3+ co-doped SiOxNy thin films has been investigated. An increasing nitrogen atomic percentage has been incorporated in the host matrix by gradually replacing oxygen with nitrogen during fabrication while maintaining the Si content unaltered, obtaining a sequential variation in the film composition from nearly stoichiometric SiO2 to SiOxNy. The study of rare earth doped single layers has allowed us to identify the parameters that yield an optimum optical performance from Ce3+ and Tb3+ ions. Ce3+ ions proved to be highly sensitive to the annealing temperature and the nitrogen content, showing strong...