Request: Apple Extended Dynamic Range, use linear instead of gamma 2.2 rendering for ImageMetal (StoreTextureFloat16Rgba)
hello_imgui's ImageMetal buffers (float16) are rendered with gamma 2.2 encoding. I would like to render it as linear.
I have modified the EDR demo code to show grayscale bars with float input linearly scaling from 0-1
https://github.com/AndrewKeYanzhe/hello_imgui_template/blob/grayscale-gamma2.2-demo-metal/hello_edr_og.mm
Digital color meter reads the middle bar as middle gray 127/128, which means that the ImageMetal buffer goes through gamma encoding. Linear float 0.5 (50 nits) would map to around 186 in gamma 2.2 encoded value.
Pinging @wkjarosz , I'm assuming for HDRView you are not using HelloImGui::ImageMetal ? I see that your app shows HDR images without gamma issues. I would love to hear how you implemented this, if possible.
I would need more explanation. I'm not proficient with EDR.
You rewrote the whole float32_to_float16 function, but apart from that I cannot see any change as far as gamma is supported.
@AndrewKeYanzhe I am not using HelloImGui::ImageMetal. I display my images using the CustomBackground callback, with a custom fragment shader that performs color management and appropriate non-linear transfer functions. If I recall, with EDR, you should output sRGB encoded values, but with appropriate mirroring of the sRGB curve to handle negative values.