.vtf export error

Discussion in 'Mapping Questions & Discussion' started by takabuschik, Nov 6, 2014.

  1. takabuschik

    aa takabuschik

    Messages:
    663
    Positive Ratings:
    316
    I made an overlay in photoshop, then extracted it to .vtf.
    As all overlay signs, the overlay is rectangular, and it has two transperent (photoshop transperent) "lines" so it could be rectangular.

    Code:
    HERE:
    @=opaque (actual sign)
    *=transperent
    
    ************************************
    ************************************
    @@@@@@@@@@@@@@@@
    @@@@@@@@@@@@@@@@
    @@@@@@@@@@@@@@@@
    @@@@@@@@@@@@@@@@
    ************************************
    ************************************
    The vmt is fine:
    Code:
    "LightmappedGeneric"
    {
    	"$baseTexture" "takabuschik/signs/sign_biohazard010b"
           	 "$decal" 1
    	"$decalscale" 0.25
    	"$alphatest" 1
     	"%keywords" "tf"
    }
    The problem is that in hammer, in vtfedit, and I assume that in game as well, it looks like this:
    [​IMG]
    (marked what should be the edges with red)

    How to make it transperent?
     
  2. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,535
    If I remember correctly, that is a result of the photoshop plugin handling transparency wrong. I would do it by making an alpha channel and exporting as TGA, then converting that to VTF with something else (vtex, vtfedit, etc).

    Another reason to do this, is your color channels should actually be "filled in", that is the beige around the edge of the sign should extend beyond the visible area. Otherwise, due to compression, there will be a white bleed-over along the edge where the no-color area under the transparency is mixed with the visible area. (Same reason when you look at a model skin, everything is painted "outside the lines")
     
    • Thanks Thanks x 1
  3. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,220
    Making the transparency mask into an alpha channel should be enough to do the trick; the Photoshop plugin has always worked fine for me. But don't forget to export as "Compressed with Alpha" rather than just "Compressed" so it actually saves the alpha channel; that's probably what you were doing wrong before.
     
  4. takabuschik

    aa takabuschik

    Messages:
    663
    Positive Ratings:
    316
    Fixed. Thank you. I didn't even have the alpha channel, now I have one, and the sign is working!
     
  5. Idolon

    aa Idolon the worst admin

    Messages:
    1,568
    Positive Ratings:
    4,558
    I'd always wondered about those white bleeding edges. Thank you so much!
     
  6. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,882
    Positive Ratings:
    4,983
    It's on and off for me. Sometimes it works, sometime it completely fails. Exporting to a targa is basically always safer
     
  7. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,535
    Which reminds me, I actually only use TGA for plain textures without anything fancy going on. One reason I use vtex (command line SDK tool) is it supports conversion direct from PSD, with special vtf parameters embedded in the file description field. Then if I have layers/effects/channels/whatever I can keep them intact and work from a single file.
     
  8. wareya

    wareya L7: Fancy Member

    Messages:
    493
    Positive Ratings:
    173
    I thought the transparency bleed thing depended on whether the image editor was stupid enough to throw away the color values of adjacent transparent pixels.
     
  9. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,535
    In some cases, yeah. Whether it is the user or the program or the exporter/converter making the transparent pixels colorless, it is still the same thing.
     
  10. Seba

    aa Seba DR. BIG FUCKER, PHD

    Messages:
    2,363
    Positive Ratings:
    2,366
    If you guys are talking about what I think you're talking about, the Clamp S/T flags fix the colored border
     
  11. Tumbolisu

    aa Tumbolisu  I ⌄ I 

    Messages:
    954
    Positive Ratings:
    937
    Doesn't look like it would do anything usefull in this example.
     
  12. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,535
    Clamp prevents the compression algorithm from considering tiled edges (and moreover, prevents the texture from tiling period) and creating edge-to-edge bleed. The problem here is a case of within-image bleed because of transparent areas.