Wide color in iOS: HSV to RGB question

Hello


Following advice from WWDC16 session "What's new with Metal, part 2" I switched textures in my application to these new _XR texture fomats (mostly RGB, which is 32 bit, and RGBA taking 64 bits where Alpha channel was needed). So far, so good, and when displaying extremely wide gradients (like gradual change from 0.0 to 1.0 on red channel alone, across 8k pixels) I see definite improvement.


The problem is, my app also contains color wheel, something like macOS Hue/Saturation wheel with separate brightness slider. Hue depends on angle, saturation changes from rim (full saturation) to center (zero, ie white). Color wheel is drawn in fragment shader, which basically determines angle and distance from center (in normalized units) and plugs these into HSV to RGB conversion routine, like this:

float3 rgb = hsvToRGB( angle, distance, brightness );


Now my question is, basically, is it good enough? I mean, hsvToRGB is generic routine, which knows absolutely nothing about wide color and stuff, and is supposed to convert full HSV rangle into full (I hope) RGB range. Which would mean that I have RGB values somewhere between 0.0 and 1.0, right? Now, if I understand aforementioned WWDC session completely, _XR textures have this extended range, with some values negative, and some above 1.0, right? So that would mean that I am displaying for the user only part of wide color gamut, which is not what I want.


I tried switching to _sRGB versions of _XR textures, but then I saw less colors, not more! Does that mean that my previous approach is correct, and that outputting hsvToRGB into ordinary RGB texture gives me full color gamut coverage?


Please help, this is drawing application I am working on, and giving the user full power of iPad Pro gorgeous screen is obviously important.

Thanks in advance

Michal

Wide color in iOS: HSV to RGB question
 
 
Q