EXR file textures. PNMImage does not load float data (vs texture().read())

Hi all!

I am trying to use PNMImage().read() to load an EXR, and then texture().load() to load the PNMImage.

Originally I was using directly texture().read() no problems, and the resulting texture was a very nice float teaxture as contained in the EXR.

The reason why I am switching to do the PNMImage now, is because I am using the setReadSize() which makes super efficient loading of high resolution images.

I tried setting up the parameters of the Texture and of the PNMImage, with no change. I always get a clipped 8 bit texture if I go the PNMImage route.

Am I doing something wrong? Or, maybe should I skip the PNMImage and there is a way to load directly the EXR textures directly from disk at half res?

Thanks so much as always!


PNMImage is not designed to handle float data. There is a separate PfmFile class that is similar to PNMImage but designed for floating-point data, which can also be loaded into a Texture. There is a resize() method to change the size as necessary.

Thanks so much! That made the trick. Is there something like setReadSize in PfmFile?


Don’t believe so, but you can just resize after the fact.

Just trying to make the read from disk faster, as they are 4k and for different monitors, setReadSize make such a difference. Thanks so much!