Skip to content

Rewrite spheric mirror to make it more efficient - #3954

Merged
alex-w merged 1 commit into
masterfrom
fix-spheric-mirror-perf
Oct 18, 2024
Merged

alex-w merged 1 commit into
masterfrom
fix-spheric-mirror-perf

Conversation

@10110111

Copy link
Copy Markdown
Contributor

The old version rewrote VBO about 150Γ—3 times per frame, which is very inefficient, especially given that the data written never change. This version writes these constant data once in the constructor of the distorter and uses them on rendering.

Fixes #3535

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
  • Housekeeping

How Has This Been Tested?

  • Enabled spheric mirror distortion, checked performance, noted improvement in frame rate.
  • Disabled distortion, checked that no errors are reported in the log.
  • Enabled again, exited Stellarium, checked that no errors are reported.
  • Run with --opengl-compat and with MESA_GL_VERSION_OVERRIDE=2.1 with distortion on, checked that the render looks as expected.
  • Build against GLES2-using Qt6, check that in this mode distortion works as expected.

NOTE: I didn't try different parameters of the distortion, nor did I check the support for a custom distortion file. I don't expect that these would be affected, but this might be worth checking.

Test Configuration:

  • Operating system: Ubuntu 20.04 LTS
  • 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

The old version rewrote VBO about 150Γ—3 times per frame, which is very
inefficient, especially given that the data written never change.
This version writes these constant data once in the constructor of the
distorter and uses them on rendering.

Fixes #3535
@github-actions

Copy link
Copy Markdown

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.

@gzotti gzotti left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

YES!
Excellent performance now. (Win11/Geforce M3070)

@alex-w alex-w added this to the 24.4 milestone Oct 18, 2024

@alex-w alex-w left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Excellent!

@alex-w
alex-w merged commit a510828 into master Oct 18, 2024
@alex-w
alex-w deleted the fix-spheric-mirror-perf branch October 18, 2024 02:11
@alex-w alex-w added the state: published The fix has been published for testing in weekly binary package label Oct 22, 2024
@github-actions

Copy link
Copy Markdown

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 Dec 22, 2024
@github-actions

Copy link
Copy Markdown

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bad performance in spheric mirror distortion mode

3 participants