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 17, 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

  • 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

[ ] Occlusion

[ ] Emission

✅ Alpha

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

[ ] DoubleSided=true

Require custom shader

[ ] VertexColor

Require custom shader

✅ Shader selector for KHR_material_unlit

baseColorFactor baseColorTexture alpha mode Unity shader
o OPAQUE Unlit/Color
o OPAQUE Unlit/Texture
o o OPAQUE require custom shader
o BLEND require custom shader
o BLEND Unlit/Transparent
o o BLEND require custom shader
o CUTOUT ----
o CUTOUT Unlit/Transparent Cutout
o o CUTOUT require custom shader

✅ Default params of KHR_material_unlit

Clone this wiki locally