Change MaterialReader to function read_material. Remove the use of 'deepcopy'.
Add print statement to test if GL_STENCIL enabled.