Is it possible to extend/modify the default materials?

For example, is it possible to add some extra code to the fragment shader for the BasicMaterial op?