In previous posts, we covered two important results of our QGIS 3D for Open Source Digital Twins crowdfunding campaign: native support for ESRI Scene Layers (I3S) in part 1, and the new point cloud processing algorithms in part 2. This third and final post covers under the hood enhancements: vector data in the 3D map view, and the rendering quality improvements that came with it. Our colleague Martin Dobias walked through these features in a recent webinar, and this post follows that talk closely.
https://youtube.com/live/vYjgWgeccLI?feature=share

The campaign was fully funded at its €75,000 target, and the features below have already landed across QGIS 4.0 and QGIS 4.2. None of this happens without the QGIS community backing it, so thank you again to everyone who supported the campaign.

3D Style Database

Point, line and polygon 3D symbols can now be saved to the style database, alongside your existing 2D symbols, so you no longer need to reload a model and set up its scale and axes from scratch every time you reuse it. 

Easily switch between your 3D style from the database

Highlight identified feature

Identifying a feature now highlights it in the 3D view as well as the 2D view, with a semi-transparent fill and a silhouette outline that stays visible even when the feature is hidden behind other objects.

3D points

3D point symbols needed the most substantial rework. Previously, using your own OBJ or glTF model instead of one of the built-in primitives (e.g. a cube or a sphere) would slow the 3D view to a crawl or crash it outright with as few as a couple of hundred objects.

QGIS now uses instanced rendering for 3D points: instead of asking the GPU to draw a model once per feature, it hands the model to the GPU once along with every position it needs to appear at, and the GPU draws it thousands of times in a single pass. This helps with both memory use and frame rate, and it no longer crashes QGIS.

That rework came with a new, custom-built loader for OBJ and glTF, which are now the two formats QGIS fully supports for 3D point models. On top of that, 3D points now support data-defined size, rotation and offset through expressions, the same mechanism already used for data-defined properties in 2D, and materials other than Phong shading, which opens the door to more realistic-looking models.

Trees represented by a single scale value

Same data, where the 3D model has been scaled randomly by an expression.

Anti-aliasing and rendering quality

Alongside functionality improvements, we also spent time on rendering quality, to make 3D scenes more pleasant to look at. The main addition here is anti-aliasing. While zooming in on an edge in the 3D view, QGIS previously rendered each pixel as either fully white or fully black, with nothing in between. With anti-aliasing enabled, those edge pixels are blended instead, giving noticeably smoother lines throughout the scene, on extruded building edges and 3D symbol outlines alike.

Buildings with no anti-aliasing effect

Vectors in QGIS 3D with anti-aliasing enabled

A second, smaller improvement is the gradient background: instead of the flat white background QGIS used by default, you can now choose a colour for the top and bottom of the canvas and let QGIS blend between them. The gradient stays fixed and does not move with the camera.

Gradient (black and blue) background in 3D scene

Performance Enhancement

QGIS’s 3D views could already show vector data (e.g as extruded polygons, 3D objects and 3D lines/polygon data) before this campaign. The main problem was performance, and during this project we tried to tackle the main ones:

  1. The first target was the tessellator in QGIS, that turns raw vector geometry into the triangular mesh sent to the GPU for rendering. We replaced the triangulation algorithm with a more robust one, fixing a bunch of crashes, and it is also faster. It now uses index buffers instead of duplicating vertices, which reduces GPU memory use. As an added feature, extruded polygons can now optionally be generated with floors, so a building block or land parcel is a closed volume rather than an open shell.
  2. Scalability was the next issue. Previously, QGIS tried to load an entire vector layer onto the GPU at once, which worked for small datasets but caused crashes or very poor performance on large ones. The old workaround was to always split a layer into a fixed 4x4 grid of tiles, regardless of how much data it held. QGIS now tiles vector data adaptively: as each tile is generated, it checks whether it holds too many features and, if so, loads only part of them, leaving the rest for more detailed tiles further in. A new setting in the 3D vector layer properties controls the maximum number of features per tile, defaulting to 1,000. You won’t see every building in a large city at once from a distance, but that level of detail simply isn’t feasible to render without heavy simplification anyway.
Details of buildings appear as you zoom in

Extras from North Road

A separate set of rendering features landed in QGIS 4.2 from North Road, and they are well worth crediting on their own:

  • A large number of additions and fixes to physically based materials
  • Greatly improved shadows, which previously tended to disappear or render at low quality
  • The sun as a light source, driven by a specific date, time and intensity, so that shadows fall correctly for the location and time you set
  • A skybox, giving scenes a proper sky with clouds that move as you pan the camera
  • Image-based lighting and a move towards a high dynamic range rendering pipeline, including a bloom effect on bright surfaces such as lit windows

Two consultancies, funded by the same community, contributing complementary work to the same release: this is what a healthy open-source ecosystem looks like. Thank you, North Road.

Wrapping up

This concludes our three-part series on the QGIS 3D crowdfunding campaign. If you haven’t already, download the latest QGIS release and try these features for yourself: load your own OBJ or glTF models onto a point layer, turn on anti-aliasing in the 3D view settings, or set the sun as a light source and try loading large 3D vector data to see how QGIS handles it..

QGIS 3D still has a long list of improvements ahead, including a move away from the now-deprecated Qt 3D framework, so there is a good chance of another crowdfunding campaign in the near future. Keep an eye out for it, and thank you again to everyone who backed this one.

You might also want to read these

Let's make the QGIS work for you

Lutra Consulting is a QGIS-focused expert provider of geospatial software development, consulting, training, and support services.

Get in touch
By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Cookie Policy for more information. Deny cookies here.