Common base class for Phong and Standard materials?

I see that some materials, for example MeshPhongMaterial and MeshStandardMaterial share common properties.

Was there a willful decision to duplicate the common properties in such classes? Or would it make sense to put the common features into a shared base class?

It’s done for simplicity. Implementing everything according to the DRY principle can sometimes make the code more complicate and harder to read. It’s not always a good thing if developers desperately want to make their code as “smart as possible”.

1 Like