Skip to content
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

Drawing to RenderTexture with sRGB conversion enabled results in banded colors #1092

Closed
Fewes opened this issue May 30, 2016 · 5 comments · Fixed by #1757
Closed

Drawing to RenderTexture with sRGB conversion enabled results in banded colors #1092

Fewes opened this issue May 30, 2016 · 5 comments · Fixed by #1757
Assignees
Projects
Milestone

Comments

@Fewes
Copy link

Fewes commented May 30, 2016

Window sRGB capability is turned on and the texture is loaded with sRGB conversion.
See this thread for more details and code example to reproduce: http://en.sfml-dev.org/forums/index.php?topic=20358.0

@LaurentGomila
Copy link
Member

@binary1248 will have to confirm this, but this is most likely because the render-texture's OpenGL context is not configured for sRGB. This bug should go away once render-textures stop using their own context (which is planned, right?).

@binary1248
Copy link
Member

This doesn't have anything to do with the way contexts are created. Whether sRGB conversion takes place is determined solely by the texture storage format or the final (window) framebuffer configuration.

The "bug" in this case is merely the lack of a getter/setter to enable sRGB storage on the texture that the RenderTexture uses as its target. This should be fixed with #1093.

@Fewes
Copy link
Author

Fewes commented May 30, 2016

This did fix the banding, but now the output differs from when rendering directly to the window, or with sRGB conversion disabled. I'm not sure if this is the expected result or not, I've added some images to the thread if you'd like to take a look.

@binary1248
Copy link
Member

I have a feeling that this has something to do with precision loss during the conversion. Maybe the texture format that the RenderTexture uses in this case just isn't "good" enough. I'll have to investigate further.

@eXpl0it3r eXpl0it3r added this to the 2.5 milestone Aug 15, 2016
@binary1248 binary1248 modified the milestones: 2.4.2, 2.5 Nov 12, 2016
@binary1248 binary1248 modified the milestones: 2.5, 2.4.2 Nov 27, 2016
@eXpl0it3r eXpl0it3r moved this from WIP to Requires Adjustments in SFML 2.5.0 Feb 27, 2017
@eXpl0it3r eXpl0it3r moved this from Requires Adjustments to WIP in SFML 2.5.0 Feb 10, 2018
@eXpl0it3r eXpl0it3r removed this from WIP in SFML 2.5.0 Feb 11, 2018
@eXpl0it3r eXpl0it3r removed this from the 2.5 milestone Feb 11, 2018
@eXpl0it3r eXpl0it3r added this to Discussion in SFML 2.6.0 via automation May 11, 2021
@eXpl0it3r eXpl0it3r added this to the 2.6 milestone May 11, 2021
@eXpl0it3r eXpl0it3r moved this from Discussion to Done in SFML 2.6.0 May 11, 2021
@eXpl0it3r
Copy link
Member

@Fewes let us know if you encounter any additional errors when using the latest master branch revision

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
SFML 2.6.0
  
Done
4 participants