  A key advantage of utilizing van der Waals materials as defect-hosting
platforms for quantum applications is the controllable proximity of the defect
to the surface or the substrate for improved light extraction, enhanced
coupling with photonic elements, or more sensitive metrology. However, this
aspect results in a significant challenge for defect identification and
characterization, as the defect's optoelectronic properties depend on the
specifics of the atomic environment. Here we explore the mechanisms by which
the environment can influence the properties of carbon impurity centres in
hexagonal boron nitride (hBN). We compare the optical and electronic properties
of such defects between bulk-like and few-layer films, showing alteration of
the zero-phonon line energies, modifications to their phonon sidebands, and
enhancements of their inhomogeneous broadenings. To disentangle the various
mechanisms responsible for these changes, including the atomic structure,
electronic wavefunctions, and dielectric screening environment of the defect
center, we combine ab-initio calculations based on a density-functional theory
with a quantum embedding approach. By studying a variety of carbon-based
defects embedded in monolayer and bulk hBN, we demonstrate that the dominant
effect of the change in the environment is the screening of the density-density
Coulomb interactions within and between the defect orbitals. Our comparative
analysis of the experimental and theoretical findings paves the way for
improved identification of defects in low-dimensional materials and the
development of atomic scale sensors of dielectric environments.
