Home Technical Talk

Using Left Over UV Space For Decals

polycounter lvl 11
Offline / Send Message
jocose polycounter lvl 11
Hey Everyone,

I'm wondering how common it is to use left over UV space for decal textures.

It makes sense on the one hand to use this space so it isn't wasted, but if your just using left over space then the majority of your texture will be filled up with things that don't have an alpha channel.

This means most of your alpha channel is wasted.

At what point is it better to use another texture for all your transparent elements?

What's the general mentality towards this sort of thing?

Replies

  • ZacD
    Offline / Send Message
    ZacD ngon master
    So basically you're asking if its better to have a decal sheet or to keep as many decals on the texture for that model as possible?

    I wouldn't know but was just clarifying the question.
  • Peris
    Offline / Send Message
    Peris polycounter lvl 17
    Since your materials would be split up anyways, it's easier/better to keep your decals on another sheet
  • Mark Dygert
    You also have to be careful of your shader(s) and that your solid object doesn't have problems sorting with other transparent textures. Most of the time that means breaking off the transparent object from the solid and applying a separate shader that has opacity mapping. Leaving the solid object with a solid shader no opacity mapping.

    If there's a chance that the two objects can be separated for example you have a grass plane in with a chunk of a building, then you might end up calling a huge texture that only uses a tiny part. If they always stick together like hair and head then it should be more or less ok.

    I'm not exactly sure about the math behind adding an alpha channel vs using a separate smaller map. I think EQ is pretty knowledgeable about that?
  • kdm3d
    You could not waste your alpha by using the rest of it for a spec mask, or height information, or anything really. Then create two shaders, one for your main object using the alpha for spec or whatever, and the other for your decals using the alpha for transparency. This means two shaders, but youd have that anyway, AND one less texture.
  • Eric Chadwick
    Depends.

    If you're using the DXT compressed texture format, then using no alpha (DXT1) is half the size of using alpha (DXT3 or DXT5). DXT1 is usually used for color maps with no alpha (well actually you can use a very crappy 2-color alpha, but whatever, no one does because it blacks out the color map). DXT3 or 5 have an alpha channel.

    You can get tricky and store other stuff in the unused alpha, like a gloss map or AO map or whatever. But the alpha'd bits wouldn't get that.
  • kdm3d
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    As mentioned above, in DXT compression, using the alpha channel will double the texture size.
    This means that you'd actually save texture memory by having your decals on a half-res separate sheet with alpha.

    For example, 512x512 main texture (no alpha) plus 256x256 decal sheet (with alpha) uses 3/4 the texture memory of a 512x512 main texture (with alpha). So at that point, assuming you were going to need decals anyway (rather than just adding them "because you can"), you're saving memory by having them on a separate sheet.
  • Shogun3d
    Offline / Send Message
    Shogun3d polycounter lvl 12
    In most cases you'll end up creating a decal sheet that will be added to a common shared folder for reference in the future. That way if you need particular decals it's easy to locate and they will have proper shaders assigned to them depending on the DXT compression. Aside from the fact that it's cheaper as mentioned above, it's more efficient and you'll thank yourself when you end up trying to find the texture you decided to throw that "leaf" alpha that you added on a whim.
  • jocose
    Offline / Send Message
    jocose polycounter lvl 11
    Wow, thanks for all the responses everyone, that's really informative. Its quite interesting the practice seams generally discouraged. I know Arena Net uses it heavily, and as far as I know they use TGAs not sure what it gets compressed down to, but their engine could be optimizing it all.
  • Shogun3d
    Offline / Send Message
    Shogun3d polycounter lvl 12
    Well if they're using DXT5's for everything and can afford to do so, then have at boss!

    But I can assure it's expensive as hell, and most do NOT.
  • 3D-209
    MoP wrote: »
    As mentioned above, in DXT compression, using the alpha channel will double the texture size.
    This means that you'd actually save texture memory by having your decals on a half-res separate sheet with alpha.

    For example, 512x512 main texture (no alpha) plus 256x256 decal sheet (with alpha) uses 3/4 the texture memory of a 512x512 main texture (with alpha). So at that point, assuming you were going to need decals anyway (rather than just adding them "because you can"), you're saving memory by having them on a separate sheet.

    This man speaks the truth.

    Also, if you have that much extra space on your texture sheet, scale up your UVs uniformly and repack! Unless you're being super picky about your pixel density, but it usually doesn't hurt to be as efficient as possible.
Sign In or Register to comment.