Home Technical Talk

Packing greyscale textures in color maps

polycounter lvl 12
Offline / Send Message
DOG-GY polycounter lvl 12
I wanted to bring this up as a discussion because I heard of this method a while back I can't remember where it was mentioned, but they called them "loaded textures", but this doesn't seem to be a popular method of handling greyscale textures.

Why not take 3 grey textures and put them into the RGB channels of a color map, then reference them as needed. Perhaps my understanding of texture calls is flawed, but doesn't this mean you're saving quite a bit at run-time because of less calls? Regardless, it saves a bit of space small scale but can save megabytes in the long run. Couldn't this allow for a more content on the artist's end because of the additional space? When it's not necessary to have color info built into the texture then is this not a viable solution?

I recently used this in a couple props just for fun and it was great. I was able to put all the information that I needed for my model in one texture (+normal map and a color multiplied in)

This seems like a great idea for props and such where colors are added in later and don't need as much fidelity and certainly an area where hand-helds could benefit, but I haven't seen this in practice.

What are your thoughts, PC? Am I just misunderstanding this subject?

Replies

  • Noors
    Options
    Offline / Send Message
    Noors greentooth
    Kinda used already for directionnal lightmaps, where light intensity from 3 directions is stored in one RGB map, while the pure color (which requires less resolution), is stored in one little map or vertex color. But i guess it could be done for a diffuse map too.

    The process would be 1 big RGB luminosity texture + 3 little RGB color textures/vertex color ?
    It adds complexity to the pipeline and shader though and 1 additional draw call in case of color textures?

    or u were just talkin about "regular" greyscale maps (gloss, specular...) >> In this case, ofc it is useful.
  • throttlekitty
    Options
    Offline / Send Message
    I've seen games pack like this to mask for multiple color variations in an outfit.

    Do you mean you mixed your diffuse and normal map together, or did I read that wrong?
  • JacqueChoi
    Options
    Offline / Send Message
    JacqueChoi polycounter
    I've used this method too.

    Great for packing all your masks together.

    I created a shader so the Gloss/Reflectivity/Emmissive were all thrown into one RGB texture.

    It's something that's easily possible with node-based shader setups.
  • DOG-GY
    Options
    Offline / Send Message
    DOG-GY polycounter lvl 12
    @Noors, yeah I'm referring to "regular" greyscale maps. I was wondering if many pipelines use this or if it just makes it more difficult to find things.
    I've seen games pack like this to mask for multiple color variations in an outfit.

    Do you mean you mixed your diffuse and normal map together, or did I read that wrong?
    JacqueChoi's example is right on the money. Similarly I did a spec/emmissive/diffuse in one texture. All I needed was orange to be multiplied into the emmissive so I was able to get a nice looking candle done with one texture and saved a ton of space.
  • Grimmstrom
    Options
    Offline / Send Message
    Grimmstrom polycounter lvl 7
    Its a great method to use but one thing to be aware of is that each channel is alot more compressed than an alpha channel which means you'll likely get compression artifacts if there's lots of gradients.

    Also if there's a lot of overlap between all three channels it will also suffer from more compression artifacts
  • Ghostscape
    Options
    Offline / Send Message
    Ghostscape polycounter lvl 13
    We used this on the last game I worked on. Had a photoshop doc with layers that looked like this:
    ~mask
     - gloss
       <pure red layer set to multiply>
         [layers composing gloss map]
     - reflection
       <pure blue layer set to multiply>
         [layers composing reflection map]
     - dirt
       <pure green layer set to multiply>
         [layers composing dirt map]
    ~normal
    ~spec
    ~diffuse
    

    the channels compress differently, and DXT compression favors red over blue over green, as far as artifacting, so this is something to consider when packing these in. Green, in particular, is really, really shitty, and shouldn't be used for anything that requires fine material definition.

    e:vv I meant DXT, specifically DXT1. AFAIK the DX normal format is 2-color only, but I'm not positive. I'm pretty sure a tech artist could weigh in better, I'm rusty as fuck on my DXT compression formats. DXT5 takes more memory if you're using alpha, as much as two DXT1 maps, and afaik still has shitty compression on green, so you effectively get 3 maps plus a shitty green for the price of 2 maps, instead of getting 2 maps plus a shitty green for the price of one map with DXT 1 (this is in terms of memory, not draw calls).
  • Brendan
    Options
    Offline / Send Message
    Brendan polycounter lvl 8
    Ghostscape wrote: »
    We used this on the last game I worked on. Had a photoshop doc with layers that looked like this:
    ~mask
     - gloss
       <pure red layer set to multiply>
         [layers composing gloss map]
     - reflection
       <pure blue layer set to multiply>
         [layers composing reflection map]
     - dirt
       <pure green layer set to multiply>
         [layers composing dirt map]
    ~normal
    ~spec
    ~diffuse
    

    the channels compress differently, and dds compression favors red over blue over green, as far as artifacting, so this is something to consider when packing these in. Green, in particular, is really, really shitty, and shouldn't be used for anything that requires fine material definition.

    I always thought that was mostly a DXT1 (especially DXTnm, I think there's even one that gives you the option to completely pillage the green channel) thing, if you find a need for it, perhaps you can use another channel (RGBA) and use DXT5.

    As for using the different layers for different things, I remember being shown a model of a Final Fantasy 13 character, the girl with long pink hair. Her hair had used 3 or 4 channels, for gloss, spec, weight and bendyness or something. How it calculated those in-game, I've no idea.
  • Elyaradine
    Options
    Offline / Send Message
    Elyaradine polycounter lvl 11
    Green, in particular, is really, really shitty, and shouldn't be used for anything that requires fine material definition.

    Um... apparently DXTnm sticks the red channel in the alpha, keeps the green channel, and wipes the red and blue channels with constant colours. (source)

    Why does it stick non-constant information in the green channel if it's "really, really shitty"? :/
  • equil
    Options
    Offline / Send Message
    because the green channel is the least shitty one.
  • DOG-GY
    Options
    Offline / Send Message
    DOG-GY polycounter lvl 12
    d1ver's shader work for a mobile level really takes advantage of this, thought it would be good to add to the discussion
    http://www.polycount.com/forum/showthread.php?t=87372
Sign In or Register to comment.