What does this ShaderLab line do: AlphaToMask True It's not documented. (Submitting a case on that.) Thank you! -Jon
Is it this, perhaps? http://msdn2.microsoft.com/en-us/library/bb205072.aspx#Alpha_To_Coverage Also found this line from the release notes: "· Added AlphaToMask command to ShaderLab (still waiting for Apple to properly implement it in Mac OS X; but it works on Windows now)." Yay Apple!
Yeah, it's there, but it's not documented because it's not of much use yet. What it does is Alpha to Coverage, like you guessed. That means, when using FSAA, alpha-tested objects can smoother outlines.
Last I saw about this was an unresolved ticket filed with Apple. Any further news or does this still not work with Apple?
-Projectors work well enough but they render each object they project on again, which is a performance monstrosity if I want to make bullet holes, for example. -I found a thread where somebody actually placed pixels on the texture of the objecty they wanted decals on, but you cannot reuse the texture. An alternate method is to use a secondary UV set like a lightmap, but lightmaps are too low-res to get any real detail. Not to mention, this method seems impractical. -By far the best method is making a plane and using the cutout shader, and displacing the plane slightly. However, this doesn't work if you want to put a decal on an object that isn't round. I have seen some examples of decals in Unity that I do not think use any of these methods, but I cannot figure out how they did it. Perhaps someone can help me out here? Decals are pretty important for my game and the help/advise would be appreciated.
There is option 4: the now open source decal framework (search the showcase board) as base for whatever you need / want
It's ten years now since this thread was opened but still no documentation about this command. Neither which settings it requires nor how exactly to use it. Just now i had a weird issue: alpha-to-coverage shader worked just fine in one project, but didn't work in another. Both projects are exactly the same, with same project structure and all the project settings same, too (the ones displayed in the inspector). The only difference is that one project is converted from U4.6 while the other created from scratch in U5. I had to manualy compare project settings files in text mode and make their actual lines identical one-by-one until I finally found what exactly caused that. It took several hours. UT, could you please document this command? It's really difficult to use something if it doesn't work in a particular case and you don't even know why.