# Multiple materials with same shader settings

**URL:** <https://forum.babylonjs.com/t/multiple-materials-with-same-shader-settings/20645>\
**Category:** Questions\
**Created:** [May 7, 2021, 10:17am UTC](https://forum.babylonjs.com/t/multiple-materials-with-same-shader-settings/20645 "2021-05-07T10:17:40Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [May 9, 2021, 10:15am UTC](https://forum.babylonjs.com/t/multiple-materials-with-same-shader-settings/20645/9 "2021-05-09T10:15:05Z")

</div>

Regarding 1/, I think you are using 4.2: there’s a bug that has been corrected in 5.0. If you want to fix it for 4.2, see [Compiling Node Materials with Instances on Safari - #18 by Evgeni\_Popov](https://forum.babylonjs.com/t/compiling-node-materials-with-instances-on-safari/16054/18)

For 2/, you need to use `clone` instead of reloading the 2nd material, and pass `true` for the 2nd parameter to reuse the same effect. There’s also some code that needs to be added to make `NodeAttributeInjector` serializable (else `clone` won’t work):

[https://playground.babylonjs.com/#RRDCNV#20](https://playground.babylonjs.com/#RRDCNV#20)

---

_[View the full topic](https://forum.babylonjs.com/t/multiple-materials-with-same-shader-settings/20645)._
