-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add convert function srgba to linear in example #433
Conversation
…ing to ospray clearify that colors are expected in linear colorspace.
…ich doe the handles the srgb_to_linear conversion the simelear to Texture2D and FrameBuffer
remove whitespaces
Right, color parameters of type float are in linear space. We may extend that in future to accept also uint32 colors (which then could be in sRGBA or in linear RGBA space). The question is, what color space should the color picker widget represent. We can probably agree that the color displayed in the color picker for the background color should then also match the color of the background. However, this can also be achieved by displaying the color widget in sRGB space (instead of converting the color when passing to OSPRay). |
The main motivation, of this pull request is that beginners are often not aware about color spaces. |
Until we have a clear idea how to support setting sRGB color on OSPRay side (which may involve merging FB color channel and texture format enums into Nevertheless, I agree that if the color checker displays "byte" values (integers in 0-255) the expectation by users is that those values should be consistent to e.g. Gimp's color checker, which is similar to sRGB textures values. Which means color from the color checker should be converted to linear. See also ocornut/imgui#578. |
"float (vec3f) I'd hoped it is clear that this is in linear space." As many formats define the option for per vertex colors, which are also often defined as floats, but in many cases has to be interpreted as sRGB (for example GLTF2 ). I already had a hard time to figure out in which file-fomat which color format is defined. But even this knowledge didn't help, In my opinion you, changing the documentation would be a first step. |
I changed documentation based on your suggestion and added an sRGB conversion in Maybe better handling can be achieved once ocornut/imgui#2943 is merged. |
see 4d32a46 |
@johguenther Perfect, thanx. |
Ospray expects color to be in linear space, the ColorPicker passes the colors as srga.
So this just converts the color spaces.
I also changed the documentation so that it clarify that colors are expected in linear space.
See behavior before change :
ColorPicker uses (50%,50%,50%) => gimp(on the right side) ( 74%,74%,74%)