WWW exr image

How can I download an exr image with WWW class and put that into a Texture2D? www.texture only supports jpg and png, and texture2d.LoadImage() also only works with byte arrays that represent jpg or png. If I try to load it either way, it gives me a question mark image. So what’s the work-around here?

For anyone attempting to do this in the future, the workaround I figured out is to save out the image’s byte array instead of the image itself, then load that byte array into a new Texture2D as raw data.

System.IO.File.WriteAllBytes( path, texture2d.GetRawTextureData( ) );

then

texture2d.LoadRawTextureData( System.IO.File.ReadAllBytes( path ) );

But keep in mind when you create the new texture2d, it needs to have the same width, height, format, and mipmaps as before.

Alternatively, build the image into an assetbundle, then pull in the assetbundle and load the Texture2D from the bundle.