In this tutorial I explain, how to animate the material IDs of the objects in the scene as well as changing the textures.