Esempio n. 1
0
        public Texture2D GetExportTexture(Texture2D texture)
        {
            var converted = TextureConverter.Convert(texture, glTFTextureTypes.Metallic, Export, null);

            TextureConverter.RemoveTextureExtension(converted, m_extension);
            return(converted);
        }
Esempio n. 2
0
        // Unity texture to GLTF data
        // ConvertToRawColorWhenNormalValueIsCompressed
        public Texture2D GetExportTexture(Texture2D texture)
        {
            var mat       = GetDecoder();
            var converted = TextureConverter.Convert(texture, glTFTextureTypes.Normal, null, mat);

            return(converted);
        }
Esempio n. 3
0
        public Texture2D GetImportTexture(Texture2D texture)
        {
            var converted = TextureConverter.Convert(texture, glTFTextureTypes.Metallic, Import, null);

            TextureConverter.AppendTextureExtension(converted, m_extension);
            return(converted);
        }
Esempio n. 4
0
        // GLTF data to Unity texture
        // ConvertToNormalValueFromRawColorWhenCompressionIsRequired
        public Texture2D GetImportTexture(Texture2D texture)
        {
            var mat       = GetEncoder();
            var converted = TextureConverter.Convert(texture, glTFTextureTypes.Normal, null, mat);

            TextureConverter.AppendTextureExtension(converted, m_extension);
            return(converted);
        }
Esempio n. 5
0
        public Texture2D GetExportTexture(Texture2D texture)
        {
#if UNITY_WEBGL && !UNITY_EDITOR
            return(texture);
#endif
            var mat       = GetDecoder();
            var converted = TextureConverter.Convert(texture, glTFTextureTypes.Normal, null, mat);
            TextureConverter.RemoveTextureExtension(converted, m_extension);
            return(converted);
        }
Esempio n. 6
0
 public Texture2D GetImportTexture(Texture2D texture)
 {
     if (!Application.isPlaying)
     {
         return(texture);
     }
     else
     {
         var mat       = GetEncoder();
         var converted = TextureConverter.Convert(texture, glTFTextureTypes.Normal, null, mat);
         TextureConverter.AppendTextureExtension(converted, m_extension);
         return(converted);
     }
 }
Esempio n. 7
0
        public Texture2D GetExportTexture(Texture2D texture)
        {
            var converted = TextureConverter.Convert(texture, glTFTextureTypes.Occlusion, Export, null);

            return(converted);
        }
Esempio n. 8
0
        public Texture2D GetImportTexture(Texture2D texture)
        {
            var converted = TextureConverter.Convert(texture, glTFTextureTypes.Metallic, Import, null);

            return(converted);
        }
Esempio n. 9
0
 // Unity texture to GLTF data
 // ConvertToRawColorWhenNormalValueIsCompressed
 public static Texture2D Export(Texture texture)
 {
     return(TextureConverter.Convert(texture, glTFTextureTypes.Normal, null, Decoder));
 }