qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.47k stars 2.99k forks source link

Rendering error when creating New 3D Map View #34324

Open lehtojaa opened 4 years ago

lehtojaa commented 4 years ago

Describe the bug

When trying to create "New 3D Map View", the layer is rendered incorrectly in the new window that opens. For example, the layer appears "multiplied" when dragged and also annoying flickering appears. Also, the background of the window is black or grey, not white. The following GIF will demonstrate this behavior: https://bit.ly/3841scy

How to Reproduce

Example dataset: Link to the DEM raster used in above demonstration of the bug (contains 'Elevation model 2m' data from the National Land Survey of Finland, 02/2020, License: CC BY 4.0): https://bit.ly/378hiSl

  1. Add a DEM raster layer ('Layer/Add layer/Add raster layer...')
  2. Go to 'View/New 3D Map View'
  3. Move the layer around, either by dragging with mouse or with the arrows in the compass tool in the window. Similarly, zoom out/in with the mouse or the tools in the window.

Notes: this has been tested with a clean profile. The problem appeared with version 3.10.2 but I have heard that this has appeared also in previous versions.

QGIS and OS versions

QGIS version 3.10.2-A Coruña | QGIS code revision 616ad4531b | Compiled against Qt 5.11.2 | Running against Qt 5.11.2 | Compiled against GDAL/OGR 3.0.2 | Running against GDAL/OGR 3.0.2 | Compiled against GEOS 3.8.0-CAPI-1.13.1 | Running against GEOS 3.8.0-CAPI-1.13.1 | Compiled against SQLite 3.29.0 | Running against SQLite 3.29.0 | PostgreSQL Client Version 11.5 | SpatiaLite Version 4.3.0 | QWT Version 6.1.3 | QScintilla2 Version 2.10.8 | Compiled against PROJ 6.2.1 | Running against PROJ Rel. 6.2.1, November 1st, 2019 | OS Version Windows 10 (10.0) | Active python plugins db_manager; MetaSearch; processing

Additional context

gioman commented 4 years ago

For example, the layer appears "multiplied" when dragged and also annoying flickering appears.

I cannot see that, here I'm on 3.10.2 on Ubuntu 18.04 as also on Windows.

lehtojaa commented 4 years ago

Hmm, strange. But you saw the animation for the behavior I was describing? This was actually tested on two of other computers with the same version: one was able to reproduce this, another one was not. But as I said, this behavior has also appeared in earlier versions. Do you have any suggestions how to proceed with further investigations?

gioman commented 4 years ago

But you saw the animation for the behavior I was describing?

yes

Do you have any suggestions how to proceed with further investigations?

maybe is a matter of graphic card/drivers?

tjukanovt commented 4 years ago

I have also faced this issue several times. I have thought that it might be a problem with graphics card, but my laptop is a relatively new Lenovo ThinkPad, so I would think that it's not the case.

edit: oh yeah: running on Windows and version 3.10.2, but faced the issue also on 3.8 at least

Here's one similar problem that I faced with vector 3D building data:

earthquake

Saijin-Naib commented 4 years ago

AMD or Intel GPUs?

roya0045 commented 4 years ago

@Saijin-Naib Intel GPU are not out yet.

Saijin-Naib commented 4 years ago

@Saijin-Naib Intel GPU are not out yet.

I'm referencing the integrated Intel GPUs in specific, which have a long and storied history of having abysmal OpenGL support.

tjukanovt commented 4 years ago

@Saijin-Naib Yes my ThinkPad has an integrated Intel UHD Graphics 620 GPU.

lehtojaa commented 4 years ago

@Saijin-Naib Yes my ThinkPad has an integrated Intel UHD Graphics 620 GPU.

I have the same.

wonder-sk commented 4 years ago

Hmm it looks like the rendering surface is not getting cleared properly between the frames, causing those artifacts.

Unfortunately this looks like some kind of incompatibility between Qt3D framework and Intel's Windows GPU driver which would be hard to debug and fix by QGIS devs :-/

Saijin-Naib commented 4 years ago

Unfortunately this looks like some kind of incompatibility between Qt3D framework and Intel's Windows GPU driver which would be hard to debug and fix by QGIS devs :-/

Intel's shit OpenGL support strikes again 🙄

It looks like with QT Versions 5.1x, they've included different rendering backends like Direct3D, Vulkan, and Metal. Perhaps there could be a context-sensitive switch for Windows + Intel to use Direct3D for now? AMD and NVIDIA should be mostly fine on OpenGL/Vulkan.

tjukanovt commented 4 years ago

@wonder-sk Ok, I see... But if some development work is done related to this that needs testing, I would definitely be happy to help.

SannaJokela commented 3 years ago

I have encountered this several times. I'm using Windows + QGIS 3.18.3. Used a citygml data here.

I33Yhz9gOs

kannes commented 11 months ago

I have encountered this several times. I'm using Windows + QGIS 3.18.3. Used a citygml data here.

I33Yhz9gOs I33Yhz9gOs

That looks like a different issue. In the original report the 3D data itself renders fine but the black 3D void without data behind it is not properly cleared of previously rendered images of the 3D data when moving.

kannes commented 11 months ago

Github-local videofied of OP's GIF demonstration instead of an obfuscated volatile Google Drive link ;) ->

qgis_3d.webm

wonder-sk commented 11 months ago

@lehtojaa could you please try with a more recent QGIS version to see if that's still a problem for you? There have been a couple of bigger changes in the 3D view since then that may have fixed it. If it is still a problem, please find out what is the OpenGL version on your system (using e.g. https://www.realtech-vr.com/home/glview)

@SannaJokela - as @kannes pointed out, this will be a different issue. Probably your scene is very large (whole world due to OSM background map?) and the near/far planes are set badly, causing this kind of flicker. Try limiting the extent of the 3D view (possible in more recent QGIS versions) to see if it helps to stop the flicker. If not, it would be good if you could provide a test project so we can give it a try.