So, I recently upgraded my project to Unity 5 and messed around with the fancy lighting. However, a visual bug has been bothering me, which is that fog seems to be affecting transparent objects with areas containing alpha of 0 (completely transparent).
Ok, well you have fog set properly. There is an edge around your decal that is not receiving fog though… otherwise they’d just be quad outlines. What if you boost your “AlphaTest Greater” by a very small amount?
Either way, if this looked correct in 4.x then something has indeed changed in the rendering pipeline to make your shader act differently in 5.0. Whether it’s a bug or not is unclear though.
Thank you very much! Increasing the AlphaTest value seemed to conceal it a bit more, but it is still noticeable (if I increase it too high, it starts to lose detail). I also found it strange that changing the shader code to this will blend perfectly with fog. I’m guessing that it’s just Unity’s rendering pipeline as you said. I will try using the shader source code as a reference to get the fog blending and see where I go from there. Anyway, thanks for your help once again, I really appreciate it!
Well, it’s not the rendering pipeline’s fault, but it’s just that the shader API changed slightly. I downloaded the built-in shaders source code from the Download Archive and took a look at the Transparent Diffuse, and sure enough it shows:
#pragma surface surf Lambert alpha__:blend__
So, I added :blend to the decal shader, and it worked like magic! Here’s the fixed shader code for anyone who needs it: