Is there any simple way to load floating point image (HDR or EXR) in Metal?
-
-
Replying to @serhii_rieznik
ImageIO supports both AFAIK, so you could CGImageSource->CGImage->CGDataProvider->CFData->replaceRegion
1 reply 0 retweets 1 like -
Replying to @warrenm @serhii_rieznik
I have some code for this, will see what I did when I’m back at my desk.
1 reply 0 retweets 1 like -
Replying to @_psonice @serhii_rieznik
This is how I did it in GLTFKit (there’s a little vImage magic in the middle to massage all HDR images into RGBA16Float):https://github.com/warrenm/GLTFKit/blob/master/Framework/GLTFMTL/Source/GLTFMTLTextureLoader.m#L167 …
1 reply 0 retweets 4 likes -
Thank you! I will check it. Yesterday I ended up using OpenEXR, which is not quite what I was looking for (I supposed to use no external libs).
1 reply 0 retweets 0 likes -
Replying to @serhii_rieznik @warrenm
Warren’s setup is a lot cleaner than mine which loads the image as NSImage, then gets CGImage and creates the texture from that. (Better in my case as I need to show the texture in the UI too, so I need the NSImage.)
1 reply 0 retweets 0 likes -
All my experiments with loading using NSImage ended up with something like “Unable to decode” (not remember exactly). I will check your code later today, maybe I was doing something wrong
1 reply 0 retweets 0 likes -
Replying to @serhii_rieznik @warrenm
Yeah, I seem to do some “draw cgimage into context” intermediate step to get around that. Will post the code up.
2 replies 0 retweets 0 likes
I’ve seen similar, at least with MTKTextureLoader. Part of the reason I wrote my own.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.