Nickel and either tantalum or niobium-codoped TiO2 and SrTiO3 photocatalysts with visible-light response for H2 or O2 evolution from aqueous solutions.