Optically and magnetically active point defects in semiconductors are interesting platforms for the development of solid-state quantum technologies. Their optical properties are usually probed by measuring photoluminescence spectra, which provide information on excitation energies and on the interaction of electrons with lattice vibrations. We present a combined computational and experimental study of photoluminescence spectra of defects in diamond and SiC, aimed at assessing the validity of theoretical and numerical approximations used in first principles calculations, including the use of the Franck-Condon principle and the displaced harmonic oscillator approximation. We focus on prototypical examples of solid-state qubits, the divacancy centers in SiC and the nitrogen-vacancy in diamond, and we report computed photoluminescence spectra as a function of temperature that are in very good agreement with the measured ones. As expected we find that the use of hybrid functionals leads to more accurate results than semilocal functionals. Interestingly our calculations show that constrained density functional theory (CDFT) and time-dependent hybrid DFT perform equally well in describing the excited state potential energy surface of triplet states; our findings indicate that CDFT, a relatively cheap computational approach, is sufficiently accurate for the calculations of photoluminescence spectra of the defects studied here. Finally, we find that only by correcting for finite-size effects and extrapolating to the dilute limit, one can obtain a good agreement between theory and experiment. Our results provide a detailed validation protocol of first principles calculations of photoluminescence spectra, necessary both for the interpretation of experiments and for robust predictions of the electronic properties of point defects in semiconductors.