Attach Shader to 2D Image to make it transparent

Hello.

How can I attach Shader to PNG Image asset(in assets window now)?

Is there any tool-based method?

Actually, I want to make this white-colored-background of PNG image transparent.

So, I searched some articles, but they only hinted me about ‘shader and transparency’.

Help me in detail!
And IF YOU HAVE TIME ENOUGH, you can show me some screenshots; because I am beginner.

Thanks.

1 Answer

1

Download gimp

open the image in gimp

layer->transparency-> add alpha channel

now

layer->transparency-> color to alpha…

since you white to be transparent and thats the default setup
leave it as

from (white) to alpha

click ok

file
export as…
export it as a .png

do this by simply naming the file something.png

import this asset

Go into unity

you have on the right hand side first the hierarchy then the project one and finally the inspector.

click create under project.
go midway down to material

change the shader on the new material to one of the ones in the transparent section

transparent diffuse will do fine to start.
then double click on the part that says new material. It doesnt matter will but basically by double lcicking you should make the inspector expand to show this RBG thing and texture none thing.

click select on the texture
select your new transparent texture you made in gimp and saved and imported into unity.

select the gameobject you’d like to apply this material to.

in the inspector under mesh renderer
materials
element 0

either double click and find the material you just created or drag and drop it into place.

congrats your done!

press play and you should be able to see through the image in all the parts that were white.

I coudn't do the line you describe: 'change the shader on the new material to one of the ones in the transparent section transparent diffuse will do fine to start. then double click on the part that says new material. It doesnt matter will but basically by double lcicking you should make the inspector expand to show this RBG thing and texture none thing. click select on the texture select your new transparent texture you made in gimp and saved and imported into unity.' Can you give us additional hint in more detail for me, please?