Titanium dioxide is a versatile material with ubiquitous applications, many of which are critically linked to either light absorption or transparency in the visible spectral range in addition to electrical conductivity. Doping is a well-known way to influence those properties in order to bring them into a desired range. Working towards a comprehensive understanding of the electronic and optical properties of TiO2 (as well as of the link between them) we review and summarize electronicstructure results that we obtained using cutting-edge theoretical spectroscopy techniques. We focus on the formation of electron and hole polarons and we elucidate the influence of doping on the optical properties of TiO2. In addition, we present new results for the reflectivity of pure TiO2.