The origin of the photo-emf in ferroelectric and non-ferroelectric materials