11.2. 3D Map View
3D visualization support is offered through the 3D map view. You can create, manage and open 3D map views viamenu:
By clicking on you can create a new 3D map view. A floating and dockable QGIS panel will appear (see The 3D Map View dialog). It has the same extent and view as the 2D main map canvas and provides a set of navigation tools to turn the view into 3D.
By clicking onyou get in the 3D Map Views Manager. Here you get the ability to open, duplicate, remove and rename 3D map views.
If you created one or more 3D map views, you see them listed in. You can turn them on and off by clicking on. They will be saved by saving the project, even if they are turned off.
The following tools are provided at the top of the 3D map view panel:
Identify: returns information on the clicked point of the terrain or the clicked 3D feature(s) – More details at Identifying Features
Animations: shows/hides the animation player widget
Export 3D Scene: exports the current view as a 3D scene (
.objfile), allowing post-processing in applications like Blender… The terrain and vector features are exported as 3D objects. The export settings, overriding the layers properties or map view configuration, include:
Set View Theme: Allows you to select the set of layers to display in the map view from predefined map themes.
In the 3D Configuration window there are various options to fine-tune the 3D scene:
Terrain: Before diving into the details, it is worth noting that the terrain in a 3D view is represented by a hierarchy of terrain tiles and as the camera moves closer to the terrain, existing tiles that do not have sufficient details are replaced by smaller tiles with more details. Each tile has mesh geometry derived from the elevation raster layer and texture from 2D map layers.
The elevation terrain Type can be:
Elevation: Raster or mesh layer to be used for generation of the terrain. The raster layer must contain a band that represents elevation. For a mesh layer, the Z values of the vertices are used.
Vertical scale: Scale factor for vertical axis. Increasing the scale will exaggerate the height of the landforms.
Tile resolution: How many samples from the terrain raster layer to use for each tile. A value of 16px means that the geometry of each tile will consist of 16x16 elevation samples. Higher numbers create more detailed terrain tiles at the expense of increased rendering complexity.
Skirt height: Sometimes it is possible to see small cracks between tiles of the terrain. Raising this value will add vertical walls („skirts”) around terrain tiles to hide the cracks.
Offset: moves the terrain up or down, e.g. to adjust its elevation with respect to the ground level of other objects in the scene.
This can be useful when there is a discrepancy between the height of the terrain and the height of layers in your scene (e.g. point clouds which use a relative vertical height only). In this case adjusting the terrain elevation manually to coincide with the elevation of objects in your scene can improve the navigation experience.
When a mesh layer is used as terrain, you can configure the Triangles settings (wireframe display, smooth triangles, level of detail) and the Rendering colors settings (as a uniform color or color ramp based). More details in the Mesh layer 3D properties section.
Shading disabled - terrain color is determined only from map texture
Shading enabled - terrain color is determined using Phong’s shading model, taking into account map texture, the terrain normal vector, scene light(s) and the terrain material’s Ambient and Specular colors and Shininess
up to eight Point lights: emits light in all directions, like a sphere of light filling an area. Objects closer to the light will be brighter, and objects further away will be darker. A point light has a set position (X, Y and Z), a Color, an Intensity and an Attenuation
up to four Directional lights: mimics the lighting that you would get from a giant flash light very far away from your objects, always centered and that never dies off (e.g. the sun). It emits parallel light rays in a single direction but the light reaches out into infinity. A directional light can be rotated given an Azimuth, have an Altitude, a Color and an Intensity.
a Directional light
a Shadow rendering maximum distance: to avoid rendering shadow of too distant objects, particularly when the camera looks up along the horizon
a Shadow bias: to avoid self-shadowing effects that could make some areas darker than others, due to differences between map sizes. The lower the better
a Shadow map resolution: to make shadows look sharper. It may result in less performance if the resolution parameter is too high.
In this tab, you can control different parameters like camera, 3D axis, navigation synchronization and skybox.
The Camera parameter group overrides some default camera settings made in the dialog.
With the Coordinate Reference System type an orthogonal axis will be represented.
With the Cube type, a 3D cube will be represented. The cube faces can be used to change the camera view: for example, click on the north face to set the camera to see from the north.
Right-click the 3D axis to quickly set its position and type, and the camera view.
The Navigation Synchronization parameter group adds options to synchronize 2D view with 3D camera position or 3D camera position with 2D view or bi directional synchronization. The last option displays the extent visible from the 3D camera over the 2D map view.
Panoramic texture, with a single file providing sight on 360°
Distinct faces, with a texture file for each of the six sides of a box containing the scene
Texture image files of the skybox can be files on the disk, remote URLs or embedded in the project (more details).
Map tile resolution: Width and height of the 2D map images used as textures for the terrain tiles. 256px means that each tile will be rendered into an image of 256x256 pixels. Higher numbers create more detailed terrain tiles at the expense of increased rendering complexity.
Max. screen error: Determines the threshold for swapping terrain tiles with more detailed ones (and vice versa) - i.e. how soon the 3D view will use higher quality tiles. Lower numbers mean more details in the scene at the expense of increased rendering complexity.
Max. ground error: The resolution of the terrain tiles at which dividing tiles into more detailed ones will stop (splitting them would not introduce any extra detail anyway). This value limits the depth of the hierarchy of tiles: lower values make the hierarchy deep, increasing rendering complexity.
Zoom levels: Shows the number of zoom levels (depends on the map tile resolution and max. ground error).
Show Eye Dome Lighting (EDL): a post processing effect which enhances depth perception. Each pixel’s depth (distance off the camera) is compared to its neighboring pixels» depth and gets highlighted according to that depth difference, making the edges stand out. Affects the whole scene and can be combined with Screen Space Ambient Occlusion. Following parameters can be controlled:
Lighting strength: increases the contrast, allowing for better depth perception
Lighting distance: represents the distance of the used pixels off the center pixel and has the effect of making edges thicker.
Add screen-space Ambient Occlusion (SSAO): a post processing effect which also enhances depth perception by applying a darker shading to areas which are less exposed to ambient lighting. Affects the whole scene and can be combined with Eye dome Lighting. Following parameters can be controlled:
Radius: how far we will reach to calculate ambient occlusion
Intensity: how strong the effect should be (higher values make things darker)
Occlusion threshold: how many neighboring points need to be occluded for the effect to appear (lower values than 50% will make the output darker, but possibly providing greater range of occlusion)
Debug Shadow Map: renders the scene as a red-black image from the point of view of the light used for shadows (for troubleshooting). The widget is set with a proportional Size to the 3D map view’s, and docked in a Corner.
Debug Depth Map: renders the scene’s depth map as an image with nearer pixels being darker (for troubleshooting). The widget is set with a proportional Size to the 3D map view’s, and docked in a Corner.
An animation is based on a set of keyframes - camera positions at particular times. To create an animation:
Using the navigation tools, move the camera to the position to associate with the current keyframe time.
Repeat the previous steps to add as many keyframes (with time and position) as necessary.
Click the button to preview the animation. QGIS will generate scenes using the camera positions/rotations at set times, and interpolating them in between these keyframes. Various Interpolation modes for animations are available (eg, linear, inQuad, outQuad, inCirc… – more details at https://doc.qt.io/qt-5/qeasingcurve.html#EasingFunction-typedef).
Click Export animation frames to generate a series of images representing the scene. Other than the filename Template and the Output directory, you can set the number of Frames per second, the Output width and Output height.
A vector layer with elevation values can be shown in the 3D map view by checking Enable 3D Renderer in the 3D View section of the vector layer properties. A number of options are available for controlling the rendering of the 3D vector layer.