Beginning of the Material reflection code.