Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Alpha and transparency question
#1
I have problem in Unity with sprites and transparent backgrounds. They have jagged edges.
I tried all the settigns Unity has to offer and everytime is the same. I'm left with conclusion that I need to set the sprites properly.

How to prepare the sprite in GIMP using this instructions? https://docs.unity3d.com/Manual/HOWTO-alphamaps.html

In PS


Quote:
  1. Duplicate the layer
  2. Select the lowest layer. This will be source for the dilation of the background.
  3. Select Layer->Matting->Defringe and apply with the default properties
    1. Run the “Dilate Many” action a couple of times. This will expand the background into a new layer. [Image: ImportAlpha_Dilate.png]
    2. Select all the dilation layers and merge them with Command-E
    1. Create a solid color layer at the bottom of your image stack. This should match the general color of your document (in this case, greenish). Note that without this layer Unity will take alpha from merged transparency of all layers.
  4. Now we need to copy the transparency into the alpha layer.
    1. Set the selection to be the contents of your main layer by Command-clicking on it in the Layer Palette.
    2. Switch to the channels palette.
    3. Create a new channel from the transparency.
  5. [Image: ImportAlpha_createChannel.png]
    Save your PSD file - you are now ready to go.


Reply
#2
You deserve an answer, but this being a new-ish forum not many game players around.

I know nothing about Unity and their requirements.

Looking at your reference, it takes an image from-this-to-this http://imgur.com/53peGRZ in PS using some sort of PS action file that is never going to work in Gimp.

There is a similar 'dilate' or 'erode' in Gimp but not using transparency. example
With transparency: http://imgur.com/6E8Vtex
transparency removed: http://imgur.com/yem0jDW
using Filters -> Generic -> Erode to shrink lighter areas: http://imgur.com/OTh3ZMn
and color-to-alpha to remove the white: http://imgur.com/G1OCpP1

A little like the the PS procedure. (but not much)

However, I do not think that is your problem

Quote:.. have problem in Unity with sprites and transparent backgrounds. They have jagged edges...

That indicates you have no anti-aliasing in your image

You might get a sensible answer if you post an example of your sprite / sprite-sheet, (zip it if required) and details of the image format, OS / version of Gimp.
Reply


Forum Jump: