Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upsRGB color space problem? #264
Comments
bvssvni
added
the
draft
label
Feb 6, 2017
This comment has been minimized.
This comment has been minimized.
|
Seems that none of the backends implements gamma conversion for textures. |
This comment has been minimized.
This comment has been minimized.
|
Maybe I can try to convert my texture with something like |
This comment has been minimized.
This comment has been minimized.
|
Yes, you can do this manually. I wonder why it shows wrong colors, because it seems your texture is in sRGB. This should be enabled here https://github.com/PistonDevelopers/opengl_graphics/blob/master/src/back_end.rs#L338, converting to linear color space in the shaders, and back when writing to the frame buffer. |
This comment has been minimized.
This comment has been minimized.
|
Yeah I saw that, it's weird. I even tried with other images, same problem. |
This comment has been minimized.
This comment has been minimized.
|
I even tried several Window libraries, currently using SDL2Window, but tried GLFW and Glut with the same result. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
adfaure
commented
Jun 6, 2017
|
Hello, I will do it manually too, but will it be fixed in a future release ? |
This comment has been minimized.
This comment has been minimized.
|
@Rydgel @adfaure Would you mind sharing the code that you used to perform the conversion? I'm having trouble with this step. Edit: this is what I've got so far:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@Rydgel So I was on the right track! Thank you very much! |
This comment has been minimized.
This comment has been minimized.
Aerolivier
commented
Jan 31, 2018
•
|
Am I right in thinking this can be solved by tagging the texture data with the As far as I understand, quantising the linear values to 8 bits (like suggested as a workaround) leads to a loss of integrity in the image ( as demonstrated at http://tulrich.com/webgl/rgb/linear_vs_srgb.html ).
|

Rydgel commentedFeb 6, 2017
•
edited
Hello,
It seems I have an issue to display my texture with the correct colours. It seems like everything I tried didn't change anything.
Here is a few excerpt of how I load the texture and draw it:
So changing the
set_convert_gammavalue tofalseortruedoes nothing.Creating the Window with
.srgb(true)or.srgb(false)does nothing.I'm on OS X. I'm using Rust nightly
rustc 1.16.0-nightly (24055d0f2 2017-01-31)Cargo packages:
And here is the texture image itself