- Home /
How to read exr file (HDR texture) from disk at runtime?
It seems like the support for HDR textures is not complete since they can only be handled through the editor. I found a script that can save EXR (MiniEXR), but does anyone know of a way to load EXR at runtime?
Answer by mrgreengenes · May 06, 2018 at 05:01 PM
Wish Unity guys had a comment here. HDRI has no runtime support because of all these "Editor" vs "Player" issues.
Answer by elmax · May 24, 2017 at 09:14 AM
Late answer, but it works with Resources.Load (as Texture2D). Import settings should be done beforehands. HTH.
This is not an answer. The OP specifically pointed out it should be done at runtime, and not by importing through the editor first.
Select .exr file in Project window, and in the Inspector window, check "Read/Write Enabled". (This is the import setting part) Resources.Load does not work for me, but AssetDatabase.LoadAssetAtPath worked.
Texture2D exrTex2D = AssetDatabase.LoadAssetAtPath<Texture2D>(exrAssetPath);
Your answer
Follow this Question
Related Questions
Banding with HDR setup? 2 Answers
HDR Color Picker Returns Clamped Values 0 Answers
How to Get / Set HDR Color intensity 4 Answers