Here is a small Material Function to easily convert an ID map into a mask map.Demo video : https://youtu.be/f0lajDNjSd8