In modeling of photoabsorbing materials for solar devices, it is often assumed that the photogenerated electrons and holes remain delocalized and occupy the conduction and valence bands. However, in many complex semiconductors that are currently considered for water-splitting and solar cells, formation of polarons can be expected. We investigate how polarons affect the efficiency of solar devices on the examples of BiVO4 and Ch3NH3PbI3. For both materials, we perform hybrid functional molecular dynamics simulations to model charge localization at room temperature. Additionally, we analyze the polaron interaction with defects and their stability at the semiconductor/water interface.