I have a strange problem that hopefully someone else has seen before. I imported a texture with an alpha channel into Unity (2017.4.12f). When I set Alpha is Transparent to true, the transparent areas become multicolored. The texture looks fine in paint.net, but not in Unity. Any ideas or suggestions? Thanks.
The alpha of an image is just another data channel, like red, green, and blue. By default the alpha has no direct effect on the other color values. Also, any shader not set to be transparent is likely going to ignore the value in the alpha channel of the texture and just show the RGB values. When you check the "Alpha is Transparency" option on the texture, it doesn't change the behavior of the shaders, it's just telling the importer that any RGB value that is fully transparent won't be visible, so the importer modifies the texture to prevent possible fringing from mip mapping and bilinear filtering. Short version, if you want the alpha of your texture to be used to make something transparent, you'll need to use a shader that supports transparency.
If you're using the Standard shader, make sure to set the Rendering Mode (the drop list at the very top of the shader panel) to either Fade or Transparent. It's set to Opaque by default. In my experience, Fade tends to work better than Transparent; your mileage may vary.
Hello, sorry to necropost. Where is the alpha map supposed to be added for objects that use transparency to fake holes, etc? This chair is a single sided poly with holes using alpha. Is it possible? I also see that the back side is not well rendered even when set to render both.
For real time rendering, the alpha isn't a separate map. It's usually stored in the alpha channel of the albedo / base map.
Thanks. In that chair I used a png for the albedo map. But Unity doesn't seem to be reading the transparency? The holes are not transparent in the chair.
Can you show a screen shot of your texture import settings (including the preview image at the bottom of the inspector where it shows the format), and the entire material settings. The top that you have cutoff in the above example is the most important part.
Thanks to bgolus's reply I was able to understand and fix a similar issue. Sharing in case somebody else does too. I was working on my first custom shader that blended two textures: one texture is fully opaque and the other I wanted to use the alpha chanel to get transparency. But the latter wasn't working and the parts of the texture that should've been transparent were opaque. I assumed it was a problem with my texture export settings (from image software) or import settings (in unity), and playing with the alpha settings while importing into unity gave me the same issue as the original poster. In the end, it wasn't my export or import settings on the texture that was the problem - it was my shader. Originally, I had the respective RGBA outputs from both of the Sample Texture 2D nodes going into the base and blend inputs on the Blend node. But all I needed to do was connect the alpha channel on the texture sample 2D node from the texture I wanted transparency on to the opacity input on the blend node. And it worked. Obvious in hindsight.