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

Improve text rendering quality #3353

Merged
merged 1 commit into from
Aug 6, 2023

Conversation

10110111
Copy link
Contributor

@10110111 10110111 commented Aug 5, 2023

Description

After we switched to texture-based text rendering, colored text on bright background like direction markers on atmosphere background got a barely noticeable dark fringe.

Using alpha channel rendered by QPainter doesn't seem to be easy to get right, so this commit instead uses the RGB channel of white text rendered on black background to get intensity to modulate text color by.

The result is now closer to the one we got from QPainter over QOpenGLPaintEngine.

Screenshots

Before 1168932

Screenshot_2023-08-06_02-07-48

Before this PR

Screenshot_2023-08-06_02-08-05

After this PR

Screenshot_2023-08-06_02-07-59

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • This change requires a documentation update

How Has This Been Tested?

Test Configuration:

  • Operating system: Ubuntu 20.04
  • Graphics Card: Intel UHD Graphics 620

Checklist:

  • My code follows the code style of this project.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (header file)
  • I have updated the respective chapter in the Stellarium User Guide
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

After we switched to texture-based text rendering, colored text on
bright background like direction markers on atmosphere background got a
barely noticeable dark fringe.

Using alpha channel rendered by QPainter doesn't seem to be easy to get
right, so this commit instead uses the RGB channel of white text
rendered on black background to get intensity to modulate text color by.

The result is now closer to the one we got from QPainter over
QOpenGLPaintEngine.
@github-actions
Copy link

github-actions bot commented Aug 5, 2023

Great PR! Please pay attention to the following items before merging:

Files matching src/**/*.cpp:

  • Are possibly unused includes removed?

This is an automatically generated QA checklist based on modified files.

@alex-w alex-w added this to the 23.3 milestone Aug 6, 2023
Copy link
Member

@gzotti gzotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works also on RPi3. Thanks!

@10110111 10110111 merged commit d6351b8 into Stellarium:master Aug 6, 2023
12 checks passed
@10110111 10110111 deleted the fix-text-rendering branch August 6, 2023 14:17
@alex-w alex-w added the state: published The fix has been published for testing in weekly binary package label Sep 2, 2023
@github-actions
Copy link

github-actions bot commented Sep 2, 2023

Hello @10110111!

Please check the fresh version (development snapshot) of Stellarium:
https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

@alex-w alex-w removed the state: published The fix has been published for testing in weekly binary package label Sep 26, 2023
@github-actions
Copy link

Hello @10110111!

Please check the latest stable version of Stellarium:
https://github.com/Stellarium/stellarium/releases/latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants