Game Development Community

Help setting alpha channel for translucency

by Dean · in General Discussion · 06/22/2007 (5:53 pm) · 4 replies

I have both photoshop and gimp, and i'm trying to add translucency to an image. i know how to add transparent areas, but apparently photoshop can't do translucency properly without a superpng plug-in, but the plug in crashes when i try to use it. I downloaded gimp, but i can't figure out how to get my translucency working for an image. I've spent the last several hours looking for some sort of tutorial, trying to figure this out. I found tutorials for doing it in paintshop pro, but nothing for gimp. any help please?

#1
06/22/2007 (6:54 pm)
kimihia.org.nz/how/gimpalpha/

I don't use gimp but I did a search for you. Hope that helps you out.
#2
06/23/2007 (3:32 am)
In photoshop just set up your image without a background layer (or simple hide it) - so you can see the checkerboard through the transparent bits.

Then simply save for web (shift+cntl+alt+s) and select png-24 with the transparency checkbox clicked.

I get the feeling the the superpng plug-in was needed for older version of photoshop that didn't have export for web. Never needed to use it myself.

You'll still need to set up the transparent material in the 3D app you're using (max or whatever)
#3
06/23/2007 (5:39 am)
Chris; The problem with the way photoshop saves alpha (yes, even with the "save for web" feature) is that it doesn't save the background. This can have really bad effects in some cases (it's especially a problem with sharp edges in the alpha channel where it can result in white "halos" showing up in game). With superpng you can keep the background and make sure it is some more sane color instead of white.

Dean; Superpng should work just fine. Did you get it from the Artists page? Make sure you move the regular photoshop png plugin AWAY from the photoshop plugin folder too. Bad things (tm) can, and will happen if two plugins are registered to save/load the same file format.

To create an alpha channel for use with super png don't do what Chris said and remove the background, instead open up the "channels" tab, click the "new channel" button and paint your alpha in there. (I usually paint my alpha on a regular layer, copy/paste it into the alpha channel and then hide/remove the extra layer though).
#4
06/23/2007 (7:00 pm)
Here are some of the results that I've got using export for web in photoshop.
The first one has a hard transparency edge, the other 2 are translucent materials.
All are DTS put together in 3DSMax.

I haven't tried creating something that has a soft transparency edge, but as you can see the results I've got so far have been ok.

One thing though, if you don't bleed the texture beyond the edge of the alpha mask you may get discoloration of the edge pixels to the background color. This would produce the halo effect that you talk about.

I'm not saying I'm an expert in transparent materials (I've made maybe 10 transparent / translucent textures). I just haven't experienced the problem you described unless I haven't bled the texture beyond the mask correctly.

www.colab-aktiv.com/strangeDays/misc/transparency/chainLinkFence.jpgwww.colab-aktiv.com/strangeDays/misc/transparency/table.jpgwww.colab-aktiv.com/strangeDays/misc/transparency/waterCooler.jpg
- edit to fix bad link