Пример #1
0
        static GLTFMaterial Export_UnlitTransparent(Material m)
        {
            var material = KHRMaterialUnlit.CreateDefault();

            material.alphaMode = GLTFBlendMode.BLEND.ToString();
            return(material);
        }
Пример #2
0
        static GLTFMaterial Export_UnlitTexture(Material m)
        {
            var material = KHRMaterialUnlit.CreateDefault();

            material.alphaMode = GLTFBlendMode.OPAQUE.ToString();
            return(material);
        }
Пример #3
0
        static GLTFMaterial Export_UnlitCutout(Material m)
        {
            var material = KHRMaterialUnlit.CreateDefault();

            material.alphaMode   = GLTFBlendMode.MASK.ToString();
            material.alphaCutoff = m.GetFloat("_Cutoff");
            return(material);
        }
Пример #4
0
        private GLTFMaterial Export_UniUnlit(Material m)
        {
            var material = KHRMaterialUnlit.CreateDefault();

            var renderMode = m.GetRenderMode();

            if (renderMode == UniUnlitRenderMode.Opaque)
            {
                material.alphaMode = GLTFBlendMode.OPAQUE.ToString();
            }
            else if (renderMode == UniUnlitRenderMode.Transparent)
            {
                material.alphaMode = GLTFBlendMode.BLEND.ToString();
            }
            else if (renderMode == UniUnlitRenderMode.Cutout)
            {
                material.alphaMode = GLTFBlendMode.MASK.ToString();
            }
            else
            {
                material.alphaMode = GLTFBlendMode.OPAQUE.ToString();
            }

            var cullMode = m.GetCullMode();

            if (cullMode == UniUnlitCullMode.Off)
            {
                material.doubleSided = true;
            }
            else
            {
                material.doubleSided = false;
            }

            return(material);
        }