How to avoid double materials?

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