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

Fix color distortion in low light conditions #630

Merged
merged 3 commits into from
Jul 31, 2024

Conversation

azeey
Copy link
Contributor

@azeey azeey commented Jul 26, 2024

🦟 Bug fix

Summary

This replaces the gamma correction QML element and instead tells Qt to copy the texture as is without decoding from srgb->rgb. This is an alternative to #629

Using Renderdoc, I found that no matter what the target render texture is (RGBA8_UNORM_SRGB or RGBA8_UNORM), the back color buffer (what Qt displays on the screen) always converts it to RGB8_UNORM. I also found that there's a parameter that can be set on a texture to tell OpenGL to not do any srgb->linear conversion https://docs.imgtec.com/reference-manuals/open-gl-es-extensions/html/topics/GL_EXT/texture-sRGB-decode.html

This fixes various distortion issues. Here are some examples:

Banding in specular highlights

Before
image
After
image

Color distortion in low light conditions

Before
image

After
image

Additional information in https://github.com/azeey/gz-rendering-benchmark/tree/main/gamma_correction

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey requested a review from jennuine as a code owner July 26, 2024 23:50
@azeey azeey requested a review from iche033 July 26, 2024 23:51
@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label Jul 26, 2024
@azeey
Copy link
Contributor Author

azeey commented Jul 26, 2024

cc @athenaz2

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey added the beta Targeting beta release of upcoming collection label Jul 29, 2024
…uild failure

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey merged commit b26f652 into gazebosim:gz-gui8 Jul 31, 2024
9 checks passed
@azeey azeey deleted the srgb_skip branch July 31, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta Targeting beta release of upcoming collection 🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants