Added smoothness to the shader

It is not a good idea to hide and display the shader. Instead, we
can change the parameters of the shader depending on some
conditions. We then get rid of that flicker when the shader is
displayed.