简体   繁体   中英

Convert Texture2D to EXR (HDRI)

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 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM