| View previous topic :: View next topic |
meedja
Joined: 30 Jan 2007 Posts: 22
|
Posted: Thu Sep 20, 2007 1:02 pm Post subject: Alpha Question (sure it's simple) |
|
|
|
Hi All
Playing with unity and importing some members trees. I have the tree in, set the leaf shader to Nature/Soft Occlusion Leaves and selected the leafe texture as the main texture.
This maps the leaves on to the surface but the alpha does not seem to apply? It's there, names same os the leaf texture with 'alpha' appended but no amount of slider adjustment in the material dialog will apply it. So i'm left with green squares with nice leaf images on them.
Any thoughts on how I need to set this up so the alpha works and I see just the leaves, not the surfaces they are applied to?
Thanks
Peter |
|
| Back to top |
|
|
Aras Unity Graphics Developer

Joined: 07 Nov 2005 Posts: 3171 Location: Unity Technologies
|
Posted: Thu Sep 20, 2007 1:17 pm Post subject: |
|
|
|
What hardware are you running this on? _________________ homepage | blog |
|
| Back to top |
|
|
meedja
Joined: 30 Jan 2007 Posts: 22
|
Posted: Thu Sep 20, 2007 1:37 pm Post subject: |
|
|
|
Hi Aras
iMac 2.16 Core 2 Duo
2GB RAM
Radeon X1600 128MB
In Debug, I see the alpha attached to Element1->Second->Texture.
Peter |
|
| Back to top |
|
|
guategeek

Joined: 22 Jun 2005 Posts: 658 Location: Guatemala
|
Posted: Thu Sep 20, 2007 3:31 pm Post subject: |
|
|
|
You need one texture image with the Alpha included in a 4th color chanel. Sounds like you have two texture images one with the RGB chanels and one with the Alpha. You need to use an app like Photoshop or GIMP to put them together into a single file. - Jeff _________________ Jeff McArthur | Guategeek
http://www.unifycommunity.com |
|
| Back to top |
|
|
meedja
Joined: 30 Jan 2007 Posts: 22
|
Posted: Thu Sep 20, 2007 3:54 pm Post subject: |
|
|
|
Jeff
That did the trick. Many thanks
Peter |
|
| Back to top |
|
|
Morgan

Joined: 21 May 2006 Posts: 1107
|
Posted: Tue Sep 25, 2007 6:19 am Post subject: |
|
|
|
Probably a silly Q, but I haven't turned up the answer: can you use a .psd as an RGBA image source?
Unity seems to ignore both the psd's own transparency, and a 4th channel added to the psd. So I've been exporting PNGs, but that loses the benefit of rapid roundtrip psd editing. _________________ Morgan
adamsimmersive |
|
| Back to top |
|
|
Eric5h5
Joined: 19 Jul 2006 Posts: 6930
|
Posted: Tue Sep 25, 2007 7:06 am Post subject: |
|
|
|
| Morgan wrote: | | Probably a silly Q, but I haven't turned up the answer: can you use a .psd as an RGBA image source? |
Sure. I have no problems with the regular transparency or adding an alpha channel, though it's more often that using an actual alpha channel gets you the control you want. Make sure you're using RGBA uncompressed or DXT5 compression; I don't think anything else supports alpha channels.
--Eric |
|
| Back to top |
|
|
DocSWAB

Joined: 28 Aug 2006 Posts: 519 Location: Montana, USA
|
Posted: Tue Sep 25, 2007 3:25 pm Post subject: |
|
|
|
| Morgan wrote: | Probably a silly Q, but I haven't turned up the answer: can you use a .psd as an RGBA image source?
Unity seems to ignore both the psd's own transparency, and a 4th channel added to the psd. So I've been exporting PNGs, but that loses the benefit of rapid roundtrip psd editing. |
For whatever reason, you need to turn off the visiblity of the alpha channel (4th channel) in PhotoShop for Unity to read it right. But PSDs work like a charm, either with 4th channel alpha or transparency in the main image. |
|
| Back to top |
|
|
Morgan

Joined: 21 May 2006 Posts: 1107
|
Posted: Thu Sep 27, 2007 9:48 pm Post subject: |
|
|
|
Thanks. I will play some more and see why it wasn't working for me. _________________ Morgan
adamsimmersive |
|
| Back to top |
|
|
VICTOM

Joined: 28 Aug 2005 Posts: 221 Location: NYC - Hoboken -
|
Posted: Fri Sep 28, 2007 9:55 am Post subject: |
|
|
|
Make sure your using a shader that supports alphas.
Sometimes I just drag the .psd on the gO and say "hey what's wrong - no alpha?" then I remember that oh that shader doesn't support alpha channels.
Cheers, |
|
| Back to top |
|
|
chrusion
Joined: 05 Nov 2009 Posts: 7
|
Posted: Thu Nov 05, 2009 4:56 am Post subject: |
|
|
|
| Morgan wrote: | can you use a .psd as an RGBA image source?
Unity seems to ignore both the psd's own transparency, and a 4th channel added to the psd. |
Yes. Make sure the PSD has a default Background layer. Unity can used multi-layered PSDs, but without that default Background, it seems to ignore the alpha channel in the channels palette.
I usually make my PSDs for leaves with the leaves cut out in a layer above a background layer having a similar color to the leaves so that "edge halos" are eliminated or reduced. With PNGs, even though Unity will take the transparency of a layer as the alpha, the 'default transparent' fill color is white, which can result in a light fringe or halo around leaves.
To convert a layer to a background in PS, use Layer -> New -> Background from Layer.
Dean Scott, mfa
. |
|
| Back to top |
|
|