Home Unity

Metallic Standard Shader Texture packing

polycounter lvl 4
Offline / Send Message
echofourpapa polycounter lvl 4
I noticed something in the Standard shader that surprised me. The Metallic Map uses the R channel for metalness, A for gloss/smoothness, and G and B channels are ignored.

But both Height and Occlusion both use the G channel only, and ignore RBA.

Would it make sense to change one of those to B so that a map can be packed as such:

R: Metalness
G: Occlusion
B: Height
A: Smoothness

It seems that having both Occlusion and Height on G is a bit of a waste because it requires them to be individual textures.

If there something I am missing as to why both are on G, or was one supposed to B from the get go?

Replies

  • Eric Chadwick
    Well, if you just need one channel of data (a grayscale image) then you would probably want to use BC1 texture compression (DXT1). This is a lossy format, it adds errors when it compresses the file size. Because of the way BC1 is compressed, you get less errors in the image if you use just 1 channel and blank out the other two.

    If you need two channels of data, and want the least compression errors, the you can use BC3 compression (DXT5). With BC3, the alpha channel has the most precision, followed by the green channel. So you would store your two grayscale maps in those two channels, and blank out Red and Blue (so it compresses with less errors).

    Kind of strange to me they use Red instead of Green though. Maybe this is because it's simply the first channel. Come to think of it, the incoming channel doesn't matter, because you're probably using a PSD or a TGA or whatever, and they probably swizzle the Red into the Green channel when they make the DXT file. You don't make the DXT, they do automatically (see the bitmap settings in Unity).

    Swizzle means channel packing
    http://wiki.polycount.com/wiki/ChannelPacking

    The compression info
    http://wiki.polycount.com/wiki/Normal_Map_Compression
  • echofourpapa
    Offline / Send Message
    echofourpapa polycounter lvl 4
    I had thought of texture compression. Still though, seems like it's a waste to keep all those textures as separate files.
  • gsokol
    Offline / Send Message
    gsokol polycounter lvl 14
    Honestly its probably just an ease of use thing. Packing maps like that isn't very user friendly to people first jumping into Unity. I'm sure there are compression reasons for things as well, but keeping a low barrier to entry is Unity's MO.
Sign In or Register to comment.