Hi,

I would like to know how I can set the color range of the viewport/application/camera of my game. When I export to Windows I get the rgba color set, and it is fine, but when I export the game to iOS, and I try to read a pixel from the screen at a certain position, I get a different color, also the colors look much more shallow, like 256 color set, how do I set the color to be rgba?

Thanks for the important information. It seems I need to find a way to convert SRGB to RGB, any ideas?

Welcome to the overtly complex world of color correction. sRGB is gamma 2.2, by setting the gamma to 1.0(2.2 * 0.454545 = 0.9999, rounded up it becomes 1) you should end up with effectively linear RGB, assuming you have converted to linear space first.

https://en.wikipedia.org/wiki/SRGB http://fnordware.blogspot.com/2008/05/making-linear-icc-profile.html

be warned though that converting from 8 bits per channel sRGB to gamma 1.0 will not be a lossless process: https://blog.demofox.org/2018/03/10/dont-convert-srgb-u8-to-linear-u8/

This is new to me, for the time being all I need is a way to put a color on the screen, and then read it, and get back the same color, I need a way to get an sRGB color and turn it into an RGB color. Can anyone just give me the code of a function that does that so I can overcome this obstacle, and in time I'll learn all the theory behind it?

Thanks, this formula of converting SRGB to RGB works but I had to round it: color.r = pow(color.r, 2.2) color.r = round(color.r * 100) / 100.0 but I ended up using this property of the Viewport: keep_3d_linear = true only for the moment I pick the color of the Viewport while the Viewport is covered by the screenshot I took a moment before.

works fine now, but only on iOS, if I do keep_3d_linear = true in PC and pick a color of a pixel it doesn't work the way it should so only on iOS I do keep_3d_linear = true. I wonder if on a mac it is the same as on an iPhone. will check in the future.

Not sure current state but mac OS used to be gamma 1.8 and not sRGB, they might have changed that though.

3 years later