Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Material

ousttrue edited this page Aug 27, 2018 · 20 revisions

✅ Color

GLTF Unity
/materials/*/pbrMetallicRoughness/baseColorFactor material.color shorthand of material.SetColor("_Color", color)
/materials/*/pbrMetallicRoughness/baseColorTexture material.mainTexture shorthand of material.SetTexture("_MainTex", texture)

Metallic Roughness & Occlusion

  • Incompatible texture format

✅ Import

        // gltf to unity
        static Color32 ConvertMetallicRoughnessOcclusion(Color32 src)
        {
            return new Color32
            {
                r = src.b, // metallic
                g = src.r, // occlusion
                b = 0,
                a = (byte)(255 - src.g), // smoothness
            };
        }

[ ] Export

NormalMap

✅ Import

✅ Export

  • Unpack DXT5 Texture

Emission

✅ Import

[ ] Export

Alpha

Unity RenderType Tag glTFのmaterial.alphaModeプロパティ
Opaque OPAQUE (デフォルトなので出力は不要)
Transparent BLEND
TransparentCutout MASK

[ ] Import

✅ Export

[ ] DoubleSided=true

Require custom shader

[ ] VertexColor

Require custom shader