How to transition between materials

I am currently making a game and i would like to know how to smoothly transition between two materials, through code in javascript. I have two materials, one for the day, and another for the night. I want to change from night to day, when it is that time and from day to night, when it is night again. Right now i have it changing using renderer.sharedMaterial and im assigning the different materials there, the materials im using are stored in an array of materials which is assigned through the inspector. Its currently changing but its a quick change , but i want a smooth change. I tried Lerp but it didn’t work. I have been looking all over the reference but I haven’t found anything. Could someone please help? Thank you in advance

Here is a shader that will blend 2 skyboxes :

and here is a tutorial to show how to use it (scroll down to video 072) : is for sale | HugeDomains