Textures in channels tips&tricks

Hi, I’m creating tileable PBR textures from scans and now I’m trying to find my wokrflow for Unity. First time working with metallic/smoothness and trying to figure out best way to set my textures in engine. After some issues with roughness map I’ve ended with this:

which is a pretty what I want to achieve :). But after digging through various forums I’ve found that I can put several maps in metallic texture channels:
R - Metallic
G - AO
B - ?
A - Smoothness.

(I know I can do that type of stuff in UE, didnt know about this feature in Unity)

I want to ask is there more theese type of tricks with standard shader? Can I utilize something more in blue channel ? Anyhoo, I ending with 4 textures right now (colour, height, normal, metallic). Is this kind of workflow is best?

Another matter, after putting theese maps into channels how, I can save them to something other than .psd? (.png loosing my alpha info dont knot why :/)

Also what do You thinkg is the best texture format for Unity?

Much questions, much reading, much thanks :smile:

The default Standard shader packs these values into a predetermined layout already. The Standard shader is the PBR shader Unity uses. What goes in what texture is listed in their documentation, but it’s quite spread out to find it all.

Also know there are two versions of the Standard shader default (aka Metallic) and Specular.

Metallic setup:
Albedo = RGB Albedo Color, A Alpha (optional depending on the material’s rendering mode)
Metallic = R Metalness, A Smoothness
Normal = RGB Normals
Height = G Height
Occlusion = G Occlusion
Emission = RGB Emission Color

Specular setup is identical except there’s no metallic map, instead:
Albedo = RGB Albedo Color, A Alpha (optional depending on the material’s rendering mode)
Specular = RGB Specular Color, A Smoothness
Normal = RGB Normals
Height = G Height
Occlusion = G Occlusion
Emission = RGB Emission Color

Obviously if you’re using the metallic setup the metallic map is quite wasteful, as is the height and occlusion maps only using the G channel.

You can however setup your own surface shader to use any layout you want, including packing metallic, occlusion, height and smoothness into a single map.

6 Likes

Wow, thank You, @bgolus

I think You maxed out the answer :smile: It will be awesome if I could put height in my blue channell and by that 4 in 1 :smile:
Okay, thanks again, going to look on theese surface shaders.
Cheers Mate

If the metallic texture is only using R and A, and the Occlusion only uses G, I don’t see why you can’t combine them. However I can find nothing in the documentation that states Occlusion only uses G. It just states it’s a “greyscale” image.

1 Like

It is not in the documentation, no. But the shader code itself explicitly only uses the green channel. That’s where I got the data for the above post.

1 Like

Actually I learnt that initially from the 2015 official Standard Shader video, the info about the red channel is otherwise buried deep in the specific subject of the official doc. The shader tooltop does mention “R” channel for metalness (and “A” for smoothness), but is not instantly obvious to newbie with such abbreviation.

2 Likes

that’s sad, because the one place you’d think this information would be spelled out in detail is in the documentation. Ah well.

i know this is old topic but is there any change for packed Metallic/Smoothness/Occlusion texture in recently shader?
Are they still R/A/G channel?
Are they the same if I change source from Metallic Alpha to Albedo Alpha?
I was looking for the information of the texture for standard shader in Unity 2022/2023 but got no luck.

As far as I know there has never been any significant change in the Standard Shader. It’s been the same since Unity 5 and it’s probably never going to change at this point, since the development focus has gone to Scripted Pipeline Renderers. Keep in mind this the Standard Shader for the built-in renderer. URP and HDRP use completely different shaders.