Skip to content

Remove lines geom shader - #67356

Open
ViperMiniQ wants to merge 9 commits into
qgis:masterfrom
ViperMiniQ:remove-lines-geom-shader
Open

ViperMiniQ wants to merge 9 commits into
qgis:masterfrom
ViperMiniQ:remove-lines-geom-shader

Conversation

@ViperMiniQ

Copy link
Copy Markdown
Contributor

This PR removes the geometry shader for lines (part 3 of qgis/QGIS-Enhancement-Proposals#381).

Lines are now instanced.
Two render passes are done. One is for the segments themselves, the other is for segment joins.

For multisegment lines, the part where the lines touch is “cut”.
The cut empty space is then filled with the join.

Screenshot_20260903_094925 Screenshot_20260903_100347
Screencast_20260909_090205.webm

The above screencast shows the semi-transparent lines. We do not officially support them in QGIS, this is just to showcase how there is no overlap between join-lines and line-line. The overlap visible at one point between the lines when looking back is because of the order of the lines, that is something to consider if opacity would be supported (again, not planed for here).

Supported join types are miter and bevel.

MITER_LIMIT has been set to never create MITER joins.
That was made because the old code also never created miters, always bevels.
If that were to change at any point, test cases will have to be updated (also one of the reasons I did not do it here).

Implementation taken from:

(first part instancing of the lines)
https://wwwtyro.net/2019/11/18/instanced-lines.html
(second part, joins)
https://wwwtyro.net/2021/10/01/instanced-lines-part-2.html

AI tool usage

  • AI tool(s) (Copilot, Claude, or something similar) supported my development of this PR. See our policy about AI tool use. Use of AI tools must be indicated. Failure to be honest might result in banning.

- build line segments using pointA and pointB attributes
- pass additional pointC to line_joins shader for calculating the joins
- render joins as a separate instances (second pass)
- handle duplicates in cpp, rather than in shaders
- introduce enum to distinguish between segments and joins
- clip away the segments at joins, two segments should not overlap at joins and joins are also clipped to fill the space between the segments, but not to overlap them
- rename shader
- fix joins not showing from certain angles
@github-actions github-actions Bot added this to the 4.4.0 milestone Sep 9, 2026
@github-actions github-actions Bot added the 3D Relates to QGIS' 3D engine or rendering label Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Tests failed for Qt 6 (ALL_BUT_PROVIDERS - fedora)

One or more tests failed using the build from commit 62d2a2b

rubberband_3d_hidden_last_marker (testRubberBandHiddenLastMarker)

rubberband_3d_hidden_last_marker

Test failed at testRubberBandHiddenLastMarker at tests/src/3d/testqgsrubberband3drendering.cpp:249

Rendered image did not match tests/testdata/control_images/3d/expected_rubberband_3d_hidden_last_marker/default/expected_rubberband_3d_hidden_last_marker.png (found 85 pixels different)

The full test report (included comparison of rendered vs expected images) can be found here.

Further documentation on the QGIS test infrastructure can be found in the Developer's Guide.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Tests failed for Qt 6 (ALL_BUT_PROVIDERS - ubuntu)

One or more tests failed using the build from commit 62d2a2b

rubberband_3d_hidden_last_marker (testRubberBandHiddenLastMarker)

rubberband_3d_hidden_last_marker

Test failed at testRubberBandHiddenLastMarker at tests/src/3d/testqgsrubberband3drendering.cpp:249

Rendered image did not match tests/testdata/control_images/3d/expected_rubberband_3d_hidden_last_marker/default/expected_rubberband_3d_hidden_last_marker.png (found 85 pixels different)

The full test report (included comparison of rendered vs expected images) can be found here.

Further documentation on the QGIS test infrastructure can be found in the Developer's Guide.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
To execute locally, unzip the downloaded zip file and run bin\qgis-bin.exe in the extracted directory.
You might be prompted by Windows Defender click "Run anyway"
(Built from commit 62d2a2b)

🍎 MacOS Qt6 builds

Download MacOS Qt6 builds of this PR for testing.
This app is not notarized, run sudo xattr -d com.apple.quarantine /Applications/QGIS*.app to avoid the warning
(Built from commit 62d2a2b)

🪟 x64-windows — ❌ 1 port(s) failed

Failed: py-pandas

📦 py-pandas

from vcpkg-manifest-install.log (portfile-execute abort)

  scripts/cmake/vcpkg_from_github.cmake:120 (z_vcpkg_download_distfile)
  C:/Users/runneradmin/AppData/Local/vcpkg/registries/git-trees/910f6fd1f988c66cd5c4ee3290ff174cdbd81cf7/portfile.cmake:19 (vcpkg_from_github)
  scripts/ports.cmake:209 (include)


error: building py-pandas:x64-windows-release failed with: BUILD_FAILED
See https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli for more information.
Elapsed time to handle py-pandas:x64-windows-release: 4.1 s
Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
  https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+py-pandas
You can submit a new issue at:
  https://github.com/microsoft/vcpkg/issues/new?title=%5Bpy-pandas%5D%20build%20error%20on%20x64-windows-release&body=Copy%20issue%20body%20from%20collapsed%20section%20%22issue_body.md%22%20in%20the%20ci%20log%20output
::group::issue_body.md
Package: py-pandas:x64-windows-release@3.0.5

**Host Environment**

- Host: x64-windows
- Compiler: MSVC 19.44.35228.0
- CMake Version: 4.4.0
-    vcpkg-tool version: 2026-07-27-98d7cb0cf1f4686a3e43aa5672b6230c1d56bce8
    vcpkg-scripts version: unknown

**To Reproduce**

`vcpkg install --x-feature=3d --x-feature=auth --x-feature=bindings --x-feature=exiv2 --x-feature=gui --x-feature=pdal --x-feature=qtpositioning --x-feature=sfcgal`

**Failure logs**

Trying to download meson-1.9.0.tar.gz using asset cache https://assetcache.open-vcpkg.org/assetcache/ecd69b6734be14c467f7db67dd88c0e57ebfad83ce3ddada131ff3e43ac964523e1083d7c7f3803033a9a76adbc32ad26dd2e3aca69884269000ca64130bde07
Download successful! Asset cache hit, did not try authoritative source https://github.com/mesonbuild/meson/archive/1.9.0.tar.gz
-- Applying patch D:/a/QGIS/QGIS/build/vcpkg_installed/x64-windows-release/share/vcpkg-tool-meson/meson-intl.patch
-- Applying patch D:/a/QGIS/QGIS/build/vcpkg_installed/x64-windows-release/share/vcpkg-tool-meson/adjust-python-dep.patch
-- Applying patch D:/a/QGIS/QGIS/build/vcpkg_installed/x64-windows-release/share/vcpkg-tool-meson/adjust-args.patch
-- Applying patch D:/a/QGIS/QGIS/build/vcpkg_installed/x64-windows-release/share/vcpkg-tool-meson/remove-pkgconfig-specialization.patch
-- Applying patch D:/a/QGIS/QGIS/build/vcpkg_installed/x64-windows-release/share/vcpkg-tool-meson/meson-56879d5.diff
Added vcpkg bin path to search for dlls. Path added: D:\a\QGIS\QGIS\build\vcpkg_installed\x64-windows-release\bin
-- Found Python version '3.12.11 at D:/a/QGIS/QGIS/build/vcpkg_installed/x64-windows-release/tools/python3/python.exe'


</details>

📦 [Download `failing-port-logs-x64-windows` artifact](https://github.com/qgis/QGIS/actions/runs/35318995566/artifacts/10536452733) &middot; 📑 [Download full `build-logs-x64-windows` artifact](https://github.com/qgis/QGIS/actions/runs/35318995566/artifacts/10536372892) &middot; 🔧 [Workflow run](https://github.com/qgis/QGIS/actions/runs/35318995566) &middot; 📌 [Commit `945264e`](https://github.com/qgis/QGIS/commit/945264e536eb7f41e2b9e724c83deb653d5c88a6)
<!-- ====endsection vcpkg-failures-x64-windows-->

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.

1 participant