bghgary / glTF-Tools-for-Unity

MIT License
43 stars 10 forks source link

Export fails if textures are different sizes #5

Open bghgary opened 7 years ago

bghgary commented 7 years ago

Both ConvertToMetallic and ConvertToSpecular functions assume the input textures are of equal width and height, which is not always true.

        if (info._MainTex.width != info._MetallicGlossMap.width ||
            info._MainTex.height != info._MetallicGlossMap.height)
        {
            throw new NotImplementedException();
        }
        if (info._MainTex.width != info._SpecGlossMap.width ||
            info._MainTex.height != info._SpecGlossMap.height)
        {
            throw new NotImplementedException();
        }
bghgary commented 7 years ago

With the latest changes, occlusion must also match metallic map dimensions when exporting without the spec gloss extension.