Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Understanding metallic texture packing for GLTF exporter from Unity #30

Open
justinctlam opened this issue Jan 4, 2018 · 1 comment

Comments

@justinctlam
Copy link

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)?

@AurL
Copy link

AurL commented Jan 8, 2018

Hi @justinctlam,

It seems to be a mistake in the documentation.
The packing is occlusion(R)/roughness(G)/metalness(B)

It will be fixed asap, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants