forked from alvani/Unity-glTF-Exporter
-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
Description
I'm trying to get a good understanding of this but I'm not connecting the dots between the GLTF exporter texture packing, the documentation and Unity.
First, the Sketchfab docs say:
packing occlusion(R)/metalness(G)/roughness(B) for PBR metallicRoughness
Looking at the exporter code:
if (metallicRoughness)
{
addTexturePixels(ref metallicRoughness, ref outputColors, IMAGETYPE.B);
addTexturePixels(ref metallicRoughness, ref outputColors, IMAGETYPE.G_INVERT, IMAGETYPE.A);
}
I can conclude that the exporter takes channel R from Unity and puts it in B which is roughness.
It also takes channel A and puts it in G but inverted which is metalness.
Looking at Unity Standard Shader, it says metallic is in channel R and smoothness (inverted roughness) is in A channel.
So that means B = metallic and G = roughness which reverse of the documentation. So should the Sketchfab documentation really be saying occlusion(R)/metalness(B)/roughness(G)?