Difference between revisions of "ChannelPacking"
EricChadwick (Talk | contribs) (→Examples: unreal and unity) |
EricChadwick (Talk | contribs) (Unity specular alpha example) |
||
Line 19: | Line 19: | ||
[[image:TM_Mask_Example.jpg|thumb|600px|left|A channel-packed texture using Red, Green, Blue, and Alpha channels to store four texture masks. See [https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/HowTo/Masking/index.html Using Texture Masks] from the [https://docs.unrealengine.com/latest/INT/ Unreal Engine 4 Documentation].]]<br clear="all"/> | [[image:TM_Mask_Example.jpg|thumb|600px|left|A channel-packed texture using Red, Green, Blue, and Alpha channels to store four texture masks. See [https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/HowTo/Masking/index.html Using Texture Masks] from the [https://docs.unrealengine.com/latest/INT/ Unreal Engine 4 Documentation].]]<br clear="all"/> | ||
− | [[image: | + | [[image:StandardShaderSpecularMap1000kgWeight.png|thumb|600px|left|Unity's Standard Material has the option to store Glossiness in the alpha of the Specular (or Metallic) texture, see [https://docs.unity3d.com/Manual/StandardShaderMaterialParameterSmoothness.html Unity - Manual: Smoothness] from the [https://docs.unity3d.com/Manual/index.html Unity User Manual].]]<br clear="all"/> |
Revision as of 12:44, 21 January 2018
Channel packing means using different grayscale images in each of a texture's image channels... Red, Green, Blue, and optionally Alpha.
These channels are usually used to represent traditional RGB color data, plus Alpha transparency. However each channel is really just a grayscale image, so different types of image data can be stored in them.
Individual channels can be extracted by a shader to use them for particular effects, for example the red channel for glow, green channel for specular, blue channel for sound types, alpha channel for physics info, etc. Each channel can have a totally different layout, and thus use different UVs.
Games use this technique to avoid loading separate grayscale images, which saves Memory. However this does increase shader complexity, which can increase draw calls.
RMA is a type of packed map which contains Roughness + Metallic + Ambient occlusion, which are used with PBR (Physically Based Rendering).
Swizzle
Swizzling means to change the order of the color channels in a texture. For example, moving the red channel into the alpha channel, to prepare an image for DXT5nm compression.
Usually swizzling is done to create better results when using image compression, since the green channel sometimes uses more bits. This is because the human visual system is biased to perceive more values in the green range than in red or blue.
Examples
Compression Artifacts
If you save a channel-packed texture using DXT compression, it will probably add blocky artifacts to your maps. To learn how to reduce these errors, see Normal Map Compression.
Tools