Photoshop Files Give White Outline on Transparent Textures

Can anyone tell me how I can fix an annoyance I am having with Unity right now? When I use a photoshop file with transparency, often I get a white outline around the transparency borders. I know the issue is that when Unity converts the file, it creates the color texture where all of the transparent areas are rendered white and then it renders a transparency mask. The white outline is caused by that white area bleeding into the final masked picture. I just don’t see anywhere in unity where I can specify what I want the transparent color to be so I can match it to what I need. How have you guys fixed this?

You can see what I am talking about in my screenshot below.

387704--13343--$prollem_935.jpg

Use an alpha channel instead of relying on transparency. There’s several topics already about this, which explains in more detail.

–Eric

In Photoshop, save the transparency selection of the color layer as a new alpha channel, then add a new layer with the background color you want.

1 Like

Thanks for the responses guys. I can do the alpha channels thing, I was just hoping there was possibly an easier, more streamlined, way to handle this with Unity.

You can’t, because this is not what happens:

Unity has no part in this; there’s no such thing as transparency in a graphic; the white is present in the file; Unity doesn’t put it there.

Okay, so what I gather from this issue and experiences with importing 3DS Max files is that it relies on the software that it was created in (in this case Photoshop) to convert the file to what unity needs (like a JPEG or whatever unity works with). And since it happens in that program, Unity has no way of manipulating certain parameters such as what the “transparent” color is rendered as. So in order to get around that I have to manually create the alpha mask. How close am I on that?

Nope. :wink: Then you’d have to own Photoshop to use Photoshop files in Unity, which is not the case; it has a native importer. (Also certainly not JPEG…lossy compression = bad for source files. It’s just uncompressed image data.)

Actually you can set the matte color to be something other than white; e.g. in Photoshop you can export for web and save as a PNG, where you get to choose the matte color. However, then you have the annoyance of exporting instead of just saving the file. Also, it’s usually better to have direct control over the alpha channel anyway, since having a single matte color is often not enough.

–Eric

Interesting. I did have issues importing 3DS files without 3DS Max installed on my system. It could have been an anomaly or maybe only 3DS files need 3DS Max to convert to an OBJ file. Anyway I guess I will stick with the slightly laborious alpha chanel. I’d prefer to keep the raw files and no duplicate exported files to keep my project as neat as possible.

You should think about it more in terms of layers. When you have no background, then whatever else you have is blended in to the checkerboard pattern using a mask (alpha channel). The pixels themselves are not a mix of the foreground and background. In some applications, layering will carry over, and you won’t have to worry about fringes. Unity is not one of these; Unity has to use a flattened RGB image, along with an alpha channel, if necessary. When flattening,the pixels actually do get mixed with the background, even though Photoshop doesn’t tell you what that background is. Why this happens, I have no idea; it seems stupid that it wouldn’t keep the actual colors, but that’s the way things are, for the time being.

Unity imports .3ds files natively, but it needs Max installed in order to convert .max files to .fbx.

–Eric

@Jessy
Hopefully we get some improvements in Unity or Photoshop (whoever is responsible for this import madness) to better render the RGB image. I don’t see it in my build of 3.0 though so likely that wont happen any time soon.

@Eric
That makes sense then. I have heard the .max file format is not known to anyone but Autodesk therefore the only application that can convert it to any other file would be Max. Thanks, thats good info to know.

It’s certainly not UT; it might be Adobe. The only thing I can think of for why this is the way things work, is that if you don’t use the alpha channel of the image, it will still look like the right shape, instead of having a blocky outline. But I have no idea of the scope of what all RGBA images are used for. Maybe this was more important in ye olden days?

Perhaps. Things sure were wild in ye olden days. Forsooth the true secrets of RGBA images are lost in the days of yore.

From what I understand .max files store data for max to create the object procedurally so often the final object isn’t entirely stored in the file.

I once had a utility that could read the meshes without max but only if the object was static and saved with the stack collapsed to a mesh with no modifiers.

You should work with TGA file.

We already spoke about it here :

http://forum.unity3d.com/viewtopic.php?t=60594&highlight=mask

And 3Devils did a tutorial of all my explanation here :

http://www.3devils.com/creating-alpha-channel-textures-for-unity

This not a Unity issue but yes the PSD convert mode if Unity is not a great one for many reason you will understand in the tutorial :slight_smile:

You should not. Instead, sama.van, you should learn how to actually use alpha channels. Your methods are ridiculously overcomplicated and time-consuming.

Both the Photoshop and the PNG files seem ok in this example, saved from the same image,
both set to Transparent/Diffuse in Unity.

Little easy to say that to a guy his website is full of 3D models. :wink:

Maybe more practice than you on the subject to understand what is better for a 3D artist workflow?

I just say that in case…

There’s no reason not to use a .psd; if you don’t, you’re wasting time. It doesn’t matter how many models you have; you’d have time to make more models if you learned how to do it properly.

lol because you create texture without PSD?