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.62k stars 3.01k forks source link

3D view displays objects with tears and cuts, flickering on view change #55017

Open kannes opened 1 year ago

kannes commented 1 year ago

What is the bug or the crash?

The 3D view of QGIS shows lots of artifacts that look a bit similar to z-fighting but not exactly.

mpv-shot0012 mpv-shot0013 mpv-shot0015

Layer set to "Single Symbol" with default settings: output.webm

Layer set to "Single Symbol" with different extrusion per feature: 2.webm

Steps to reproduce the issue

  1. Load the "world" easter egg layer
  2. Set the project CRS to EPSG:3035
  3. Set the layer's 3D symboloty to Simple Symbol (or something more complex if you like)
  4. Zoom to Germany
  5. Open a new 3D view and tilt the camera
  6. The objects displayed in the 3D view are flickering with tears and cuts

You can also see this on extruded features (e.g. "fid"*1000+100 as expression for extrusion) as shown above.

Versions

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

QGIS version | 3.32.3-Lima | QGIS code branch | Release 3.32 -- | -- | -- | -- Compiled against Qt | 5.15.10 | Running against Qt | 5.15.11 Python version | 3.11.5 Compiled against GDAL/OGR | 3.7.1 | Running against GDAL/OGR | 3.7.2 PROJ version | 9.3.0 EPSG Registry database version | v10.094 (2023-08-08) GEOS version | 3.12.0-CAPI-1.18.0 Compiled against SQLite | 3.43.1 | Running against SQLite | 3.43.2 PDAL version | 2.5.6 PostgreSQL client version | 16.0 SpatiaLite version | 5.1.0 QWT version | 6.2.0 QScintilla2 version | 2.14.1 OS version | Arch Linux   |   |   |   Active Python plugins db_manager | 0.1.20 grassprovider | 2.12.99 processing | 2.12.99 QGIS version 3.32.3-Lima QGIS code branch [Release 3.32](https://github.com/qgis/QGIS/tree/release-3_32) Compiled against Qt 5.15.10 Running against Qt 5.15.11 Python version 3.11.5 Compiled against GDAL/OGR 3.7.1 Running against GDAL/OGR 3.7.2 PROJ version 9.3.0 EPSG Registry database version v10.094 (2023-08-08) GEOS version 3.12.0-CAPI-1.18.0 Compiled against SQLite 3.43.1 Running against SQLite 3.43.2 PDAL version 2.5.6 PostgreSQL client version 16.0 SpatiaLite version 5.1.0 QWT version 6.2.0 QScintilla2 version 2.14.1 OS version Arch Linux Active Python plugins db_manager 0.1.20 grassprovider 2.12.99 processing 2.12.99 ### Supported QGIS version - [X] I'm running a supported QGIS version according to [the roadmap](https://www.qgis.org/en/site/getinvolved/development/roadmap.html#release-schedule). ### New profile - [X] I tried with a new [QGIS profile](https://docs.qgis.org/latest/en/docs/user_manual/introduction/qgis_configuration.html#working-with-user-profiles) ### Additional context This is happening on all systems I tested, across Linux and Windows, with Intel and NVIDIA and MESA SVGA3D
kannes commented 1 year ago

cc @wonder-sk re vertex soup https://github.com/qgis/QGIS/issues/40324#issuecomment-1772408192

wonder-sk commented 1 year ago

What you're experiencing is in fact z-fighting especially when you set no extrusion - there is terrain entity at zero elevation (with 2d map texture on it) fighting with the countries entity, also at zero elevation. There are various ways to fix it, e.g.:

The other issue is that 3D views work generally quite badly with world-wide data, and you will be hitting all sorts of issues in rendering and camera navigation when trying to work with the whole world. In 3D view settings, there is an option to limit 3D scene's extent, and I would strongly recommend everyone to use it :-) Generally speaking, areas spanning more than 1000 km will be likely it have issues (due to single-precision floats used by GPUs - we have not implemented tricks yet that would avoid that).

When you experience some weirdness in 3D view, it can be useful to open the On-screen navigation panel and check "Show camera info (for debugging)". It will show a bunch of numbers that can tell if there's something weird going on in the scene :-) For example, if near/far plan are very far apart (e.g. 1 million or more), you're either using a very large scene or something went crazy. (similarly with camera X/Y/Z position - center of the 3D scene has coordinates [0,0,0], Y is elevation above ground and X/Z are coordinates on the ground plane).

All in all, it boils down to a couple of things:

uclaros commented 1 year ago

In 3D view settings, there is an option to limit 3D scene's extent, and I would strongly recommend everyone to use it :-)

Setting the project's 2d extent in project properties > view settings will also do, for the cases when one's project has a specific area of interest but also includes larger or global layers.