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

3D views: use the correct resolution on high DPI displays! #60247

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wonder-sk
Copy link
Member

Nowadays Qt gives us size in device independent pixels, and we were using those values for the textures as well - but that means on high DPI screens where device pixel ratio is 2, we were rendering in low resolution and then upscaling the textures. This should fix that, and intermediate textures use the correct size - the rendered output is much crispier, yay!

One potential problem is that existing QGIS projects may start to look slightly different, because e.g. line width or point sizes are in pixels - so on a high DPI screen one may need to double those values to get similar looking scene. And yes, we should move towards using millimeters like in 2D maps to avoid these issues...

Some examples from my laptop below (device pixel ratio = 2). Notice the more detailed edge lines or finer details in the point cloud.

Before After
3d-edges-lowdpi 3d-edges-highpi
3d-point-cloud-lowdpi 3d-point-cloud-highdpi

Nowadays Qt gives us size in device independent pixels, and we were
using those values for the textures as well - but that means on high DPI
screens where device pixel ratio is 2, we were rendering in low resolution
and then upscaling the textures. This should fix that, and intermediate
textures use the correct size - the rendered output is much crispier, yay!
@wonder-sk wonder-sk added the 3D Relates to QGIS' 3D engine or rendering label Jan 23, 2025
@github-actions github-actions bot added this to the 3.42.0 milestone Jan 23, 2025
Copy link

github-actions bot commented Jan 23, 2025

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit ae35bb3)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit ae35bb3)

@m-kuhn
Copy link
Member

m-kuhn commented Jan 23, 2025

Nice!
Worth backporting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3D Relates to QGIS' 3D engine or rendering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants