Did you have a look at the Traditional Game Surface shader how it uses shadows? That's how I usually do it when I decide to use shadows. As for having a dynamic amount of texture inputs I posted a thread asking about this earlier. Sadly I don't think there's any solution. I didn't get any replies, but I'm doubtful. I did…