The Sprites/Default shader multiplies the color with the provided tint, while I need to add it instead. I fixed this copying the shader (taken from here) and simply changing the line

return tex2D(_MainTex, IN.texcoord) * IN.color;


to

return tex2D(_MainTex, IN.texcoord) + IN.color;


Is this the right approach, or there was a better one? (which uses something like inheritance, as opposite to copy-pasting)

Also, is this legal? I assume they allow you to use it at will, but technically there's no licence attached to the shader, so I'm not sure. Maybe that's covered somewhere in the Unity license?

• What do you mean if you want to "add" the color? The first return statement indeed, like you mentioned, tints the texture with a certain color but what is it exactly that you want to create? Do you have a reference or something? – Dries Jan 4 '14 at 13:44
• What you're doing is completely fine. I can't think of any simpler way to achieve what you're trying to do. IANAL, but Unity provides the included shaders & scripts as a base with the express purpose of developers building upon them. Something as simple as a textured sprite shader isn't worth getting proprietary over. ;) – DMGregory Jan 4 '14 at 21:34
• @DMGregory you may put it into an answer, then ;) – o0'. Jan 4 '14 at 23:34
• I figured I'd leave answering for someone with some evidence to back up the point, since all I've really got is opinion (which I may think is sound, but still). – DMGregory Jan 5 '14 at 16:05
• not to sure on this one, but isnt this the update that unity released in 3.0? basically shouldn't really matter which one you choose i dont think, if this is the case just go with the more recent version. Might look into this. – lemunk Jan 6 '14 at 14:45

According to this answer, you can either include common files, but this isn't the case, or use the UsePass command, but is not helpful here either.