- Home /
How do I Import Alpha Textures... with GIMP.
Hi Folks,
Can anyone teach me how to do the steps involved in the FAQ "How do I Import Alpha Textures?" (http://unity3d.com/support/documentation/Manual/HOWTO-alphamaps.html) but with GIMP or directly exporting PNGs from Inkscape?
Thanks everybody! Fred
Answer by Frederico Zveiter · Apr 19, 2011 at 11:47 PM
Forget it!
I just found that, using GIMP, there is no need to create an explicit alpha channel. Simply open the problematic "white around edges" PNG and re-save it unchecking the option "save color values from transparent pixels".
When you import it into Unity and apply it in a material with shader "Transparent/Diffuse" it works perfectly.
I also think that this solution is much simpler and more practical than the solution with Photoshop. Since GIMP is a free multiplatform tool, I recommend it to everyone who has this problem.
Best wishes!
It is very important to remember to applay an appropriate shader that supports an alpha channel. I missed this step when trying to figure out why my images was not showing its alpha channel. I have also found that the "unlit/transparent Cutout works" well as a shader selection.
The Oz
Answer by WhendricSo · May 29, 2012 at 08:13 PM
I had some issues getting this to work, but I eventually found a solution. Hopefully, this will clear up a bit of confusion for others with creating alpha map textures with GIMP for Unity.
To do this in GIMP, you need to
make three copies of your image layer.
Then, on the middle layer, right click on the layer and remove the alpha channel, then add it back in, making sure your background color (in the color picker) is white.
On this layer, use the "Generic -> Erode" filter on it numerous times, 10-20 times should do it. If any areas of your image are still white, paint them with a neutral tone from your image.
Hide the bottom layer, which should still be the same as the original image with alpha and everything.
Merge visible layers
Right click the hidden layer and select "alpha to selection"
Return to the layer you eroded, invert selection, then delete
Delete the bottom layer so there is only one layer (this is very important because otherwise GIMP won't save the transparent pixels properly)
Save you PNG file with "save colors from transparent pixels" checked and "save background color" unchecked
This will create perfectly seamless PNG textures with GIMP, with no graphical artifacts even when mipmaps are drawn (which is how Unity optimizes distance drawing of textures).
Hopefully this will make your grass, plants, icons, etc look great and most of all professional in Unity!
Your answer
Follow this Question
Related Questions
Transparent texture contains other color 1 Answer
unity png color bleeding 1 Answer
Tree leaves are only one sided 0 Answers
How to get rid of dark line on the edge of transparent pixels? 2 Answers