Given the new check above, all this:
```
var materialChanged = typeof this._material === 'undefined' ||
    this._material !== this.material;
if (materialChanged) {
```
can just be
```
if (this._material !== this.material) {
```