Materials:  Render it once per frame.

material_library generates materials which each contain a list of objects to be
rendered.
Materials:  Sort them before rendering to increase identical textures

Some materials can share the same material, hence we sort the materials by
comparing the value of their textures id_.