0

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.

Programmer
  • 121,791
  • 22
  • 236
  • 328

1 Answers1

0

Unity 5.6 just got released and surprisingly, it has the API to perform this Texture2D to EXR conversion.

To convert Texture2D to EXR (HDR)

byte []exrBytes  = texture.EncodeToEXR();

To convert Texture2D to EXR (HDR) Compressed

byte[] exrBytes = texture.EncodeToEXR(Texture2D.EXRFlags.CompressZIP);  

More EXR encoding flags can be found here.

Programmer
  • 121,791
  • 22
  • 236
  • 328