added support for multiple material models.