public ImageId SaveImageHDR(Texture2D texture, EHDRTextureType type, int maxSize = -1, string path = null)
        {
            if (_texture2d2ImageID.ContainsKey(texture))
            {
                return _texture2d2ImageID[texture];
            }

            string format = ".png";
            string[] pathes;
            if (path == null)
            {
                pathes = GetTextureOutPath(texture, format);
            }
            else
            {
                pathes = ExporterUtils.GetAssetOutPath(path, format);
            }
            var exportPath = pathes[0];
            var pathInGlTF = pathes[1];

            var newtex = GLTFTextureUtils.HDR2RGBD(texture);

            if (maxSize > 0 && (newtex.width > maxSize || newtex.height > maxSize))
            {
                TextureScale.Bilinear(newtex, maxSize, maxSize);
            }

            byte[] content = newtex.EncodeToPNG();

            return GenerateImage(content, exportPath, pathInGlTF);
        }
        public TextureId SaveTextureHDR(Texture2D texture, EHDRTextureType type, int maxSize = -1, string path = null)
        {
            if (type != EHDRTextureType.RGBD)
            {
                throw new Exception("HDR Texture can only be exported as 'RGBD' now !");
            }

            var isGammaSpace = PlayerSettings.colorSpace == ColorSpace.Gamma;
            if (isGammaSpace)
            {
                // we need linear space lightmap in Sein
                Debug.LogWarning("You are using lightmap in `Gamma ColorSpace`, it may have wrong result in Sein ! Please checkout 'http://seinjs.com/guide/baking' for details !");
            }

            if (_texture2d2ID.ContainsKey(texture))
            {
                return _texture2d2ID[texture];
            }

            var imageId = SaveImageHDR(texture, type, maxSize, path);

            return GenerateTexture(texture, imageId);
        }