Home Technical Talk

texture alpha bleeding (any help?)

polycounter lvl 14
Offline / Send Message
Belias polycounter lvl 14
hello

i read this article

http://docs.unity3d.com/Documentation/Manual/HOWTO-alphamaps.html

now are there any utility or software that will fix the alpha automatically?

thanks.

Replies

  • peanut™
    Options
    Offline / Send Message
    peanut™ polycounter lvl 19
    Belias wrote: »
    now are there any utility or software that will fix the alpha automatically?

    What are trying to say by "Fix" the alpha ?
  • Ashaman73
    Options
    Offline / Send Message
    Ashaman73 polycounter lvl 6
    The issue is, that the RGB values of texels with an alpha value of 0 will bleed into the RGB value of neighbor texels with alpha >0. One way to solve this problem is, to expand the border RGB values, an other way is the usage of pre-multiplied alpha textures. The latter is often the better way, but you need to use the according material/shader in your engine.

    More technically background:
    In this case you multiply the RGB value with the alpha value (alpha of 0 will result in black RGB ). Instead of blending your surface (often foilage) with (fg*alpha, bg*inverse_alpha), you can use the following blending mode: (fg*ONE,bg*inverse_alpha). The RGB color will in fact only be added to the surface, even if the black RGB values bleed into the border RGB values, it will not result in wrong colors, only darker one at most.

    To generate a pre-multiplied texture do the following (PS/Gimp).
    1. Add a new, fully solid(alpha=white), layer (top).
    2. Copy the alpha mask into the RGB channel of this layer.
    3. Set the layer to multiply.
  • Eric Chadwick
    Options
    Offline / Send Message
    Quick way to expand the edge pixels in Photoshop... use the Solidify filter from Flaming Pear. It's in the Free Plugins zip:
    http://www.flamingpear.com/download.html

    For example
    http://www.polycount.com/forum/showpost.php?p=1785248&postcount=5
  • Belias
    Options
    Offline / Send Message
    Belias polycounter lvl 14
    thanks eric and all.
Sign In or Register to comment.