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

            TextureConverter.RemoveTextureExtension(converted, m_extension);
            return(converted);
        }
Example #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);
        }
Example #3
0
        public Texture2D GetImportTexture(Texture2D texture)
        {
            var converted = TextureConverter.Convert(texture, glTFTextureTypes.Metallic, Import, null);

            TextureConverter.AppendTextureExtension(converted, m_extension);
            return(converted);
        }
Example #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);
        }
Example #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);
        }
Example #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);
     }
 }
Example #7
0
        public Texture2D GetExportTexture(Texture2D texture)
        {
            var converted = TextureConverter.Convert(texture, glTFTextureTypes.Occlusion, Export, null);

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

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