# How to avoid double materials?

**URL:** <https://forum.babylonjs.com/t/how-to-avoid-double-materials/61486>\
**Category:** Questions\
**Created:** [November 19, 2025, 4:42pm UTC](https://forum.babylonjs.com/t/how-to-avoid-double-materials/61486 "2025-11-19T16:42:05Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![inteja](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/inteja/32/22553_2.png) [@inteja](https://forum.babylonjs.com/u/inteja)\
**Post date:** [November 19, 2025, 8:44pm UTC](https://forum.babylonjs.com/t/how-to-avoid-double-materials/61486/4 "2025-11-19T20:44:00Z")

</div>

@Hans75 There’s some code here from @shaderbytes to deduplicate materials that I’ve found useful.

> [@How to avoid duplicate materials with multi asset loading](https://forum.babylonjs.com/t/how-to-avoid-duplicate-materials-with-multi-asset-loading/10748/4):
>
> @Deltakosh I know we marked this as solved but I thought to share some code here to help others who might want to look into this. The reason being , it was not a straight forward thing to do as I discovered some peculiar race conditions that will definitely catch a person of guard when trying to do this. The race condition is in thinking that the scene material list gets updated exactly once just before each loadSuccess callback while loading several items. What I found is that when loading s…

---

_[View the full topic](https://forum.babylonjs.com/t/how-to-avoid-double-materials/61486)._
