I am looking for a way to convert Texture2D
directly to EXR format in byte array. I've done few research and this seems to be complicated than I thought.
Not really looking for a code since I don't have one. Just a suggestion on how to do this.
Unity 5.6 刚刚发布,令人惊讶的是,它具有执行 Texture2D 到 EXR 转换的 API。
将 Texture2D 转换为 EXR (HDR)
byte []exrBytes = texture.EncodeToEXR();
将 Texture2D 转换为压缩后的 EXR (HDR)
byte[] exrBytes = texture.EncodeToEXR(Texture2D.EXRFlags.CompressZIP);
更多 EXR 编码标志可以在这里找到。