Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3D] qgs3dmapscene: Compute max clip planes #59328

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

ptitjano
Copy link
Contributor

@ptitjano ptitjano commented Nov 4, 2024

Description

The number of available clip planes depends on the OpenGL implementation.

This change Introduces a new function in Qgs3DUtils function called Qgs3DUtils::getOpenGLMaxClipPlanes to compute this number (GL_MAX_CLIP_PLANES) and use it in the 3D scene.

See: https://registry.khronos.org/OpenGL-Refpages/gl2.1/xhtml/glClipPlane.xml

@ptitjano ptitjano self-assigned this Nov 4, 2024
@github-actions github-actions bot added this to the 3.42.0 milestone Nov 4, 2024
@ptitjano ptitjano added the 3D Relates to QGIS' 3D engine or rendering label Nov 4, 2024
Copy link
Contributor

@benoitdm-oslandia benoitdm-oslandia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! It misses a comment I think

Copy link

github-actions bot commented Nov 4, 2024

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 79a5011)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 79a5011)

Copy link

github-actions bot commented Nov 4, 2024

Tests failed for Qt 5

One or more tests failed using the build from commit 00881ae

polygon3d_extrusion_clipping (testExtrudedPolygonsClipping)

polygon3d_extrusion_clipping

Test failed at testExtrudedPolygonsClipping at tests/src/3d/testqgs3drendering.cpp:490

Rendered image did not match tests/testdata/control_images/3d/expected_polygon3d_extrusion_clipping/expected_polygon3d_extrusion_clipping.png (found 77226 pixels different)

polygon3d_extrusion_data_defined_phong_clipping (testExtrudedPolygonsDataDefinedPhongClipping)

polygon3d_extrusion_data_defined_phong_clipping

Test failed at testExtrudedPolygonsDataDefinedPhongClipping at tests/src/3d/testqgs3drendering.cpp:708

Rendered image did not match tests/testdata/control_images/3d/expected_polygon3d_extrusion_data_defined_phong_clipping/expected_polygon3d_extrusion_data_defined_phong_clipping.png (found 77226 pixels different)

polygon3d_extrusion_data_defined_gooch_clipping (testExtrudedPolygonsDataDefinedGoochClipping)

polygon3d_extrusion_data_defined_gooch_clipping

Test failed at testExtrudedPolygonsDataDefinedGoochClipping at tests/src/3d/testqgs3drendering.cpp:827

Rendered image did not match tests/testdata/control_images/3d/expected_polygon3d_extrusion_data_defined_gooch_clipping/expected_polygon3d_extrusion_data_defined_gooch_clipping.png (found 77226 pixels different)

line_rendering_clipping (testLineRenderingClipping)

line_rendering_clipping

Test failed at testLineRenderingClipping at tests/src/3d/testqgs3drendering.cpp:1084

Rendered image did not match tests/testdata/control_images/3d/expected_line_rendering_clipping/expected_line_rendering_clipping.png (found 5327 pixels different)

buffered_lines_clipping (testBufferedLineRenderingClipping)

buffered_lines_clipping

Test failed at testBufferedLineRenderingClipping at tests/src/3d/testqgs3drendering.cpp:1293

Rendered image did not match tests/testdata/control_images/3d/expected_buffered_lines_clipping/expected_buffered_lines_clipping.png (found 15111 pixels different)

sphere_rendering_clipping (testInstancedRenderingClipping)

sphere_rendering_clipping

Test failed at testInstancedRenderingClipping at tests/src/3d/testqgs3drendering.cpp:1681

Rendered image did not match tests/testdata/control_images/3d/expected_sphere_rendering_clipping/expected_sphere_rendering_clipping.png (found 1621 pixels different)

mesh3d_clipping (testMeshClipping)

mesh3d_clipping

Test failed at testMeshClipping at tests/src/3d/testqgsmesh3drendering.cpp:375

Rendered image did not match tests/testdata/control_images/3d/expected_mesh3d_clipping/expected_mesh3d_clipping.png (found 19394 pixels different)

pointcloud_3d_singlecolor_clipping (testPointCloudSingleColorClipping)

pointcloud_3d_singlecolor_clipping

Test failed at testPointCloudSingleColorClipping at tests/src/3d/testqgspointcloud3drendering.cpp:319

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.

@ptitjano ptitjano force-pushed the map-clip-planes-compute branch 2 times, most recently from 00881ae to 3f884a1 Compare November 4, 2024 15:53
Copy link

github-actions bot commented Nov 4, 2024

Tests failed for Qt 6

One or more tests failed using the build from commit 00881ae

polygon3d_extrusion_clipping (testExtrudedPolygonsClipping)

polygon3d_extrusion_clipping

Test failed at testExtrudedPolygonsClipping at tests/src/3d/testqgs3drendering.cpp:490

Rendered image did not match tests/testdata/control_images/3d/expected_polygon3d_extrusion_clipping/expected_polygon3d_extrusion_clipping.png (found 77226 pixels different)

polygon3d_extrusion_data_defined_phong_clipping (testExtrudedPolygonsDataDefinedPhongClipping)

polygon3d_extrusion_data_defined_phong_clipping

Test failed at testExtrudedPolygonsDataDefinedPhongClipping at tests/src/3d/testqgs3drendering.cpp:708

Rendered image did not match tests/testdata/control_images/3d/expected_polygon3d_extrusion_data_defined_phong_clipping/expected_polygon3d_extrusion_data_defined_phong_clipping.png (found 77226 pixels different)

polygon3d_extrusion_data_defined_gooch_clipping (testExtrudedPolygonsDataDefinedGoochClipping)

polygon3d_extrusion_data_defined_gooch_clipping

Test failed at testExtrudedPolygonsDataDefinedGoochClipping at tests/src/3d/testqgs3drendering.cpp:827

Rendered image did not match tests/testdata/control_images/3d/expected_polygon3d_extrusion_data_defined_gooch_clipping/expected_polygon3d_extrusion_data_defined_gooch_clipping.png (found 77226 pixels different)

line_rendering_clipping (testLineRenderingClipping)

line_rendering_clipping

Test failed at testLineRenderingClipping at tests/src/3d/testqgs3drendering.cpp:1084

Rendered image did not match tests/testdata/control_images/3d/expected_line_rendering_clipping/expected_line_rendering_clipping.png (found 5327 pixels different)

buffered_lines_clipping (testBufferedLineRenderingClipping)

buffered_lines_clipping

Test failed at testBufferedLineRenderingClipping at tests/src/3d/testqgs3drendering.cpp:1293

Rendered image did not match tests/testdata/control_images/3d/expected_buffered_lines_clipping/expected_buffered_lines_clipping.png (found 15111 pixels different)

sphere_rendering_clipping (testInstancedRenderingClipping)

sphere_rendering_clipping

Test failed at testInstancedRenderingClipping at tests/src/3d/testqgs3drendering.cpp:1681

Rendered image did not match tests/testdata/control_images/3d/expected_sphere_rendering_clipping/expected_sphere_rendering_clipping.png (found 1621 pixels different)

mesh3d_clipping (testMeshClipping)

mesh3d_clipping

Test failed at testMeshClipping at tests/src/3d/testqgsmesh3drendering.cpp:375

Rendered image did not match tests/testdata/control_images/3d/expected_mesh3d_clipping/expected_mesh3d_clipping.png (found 19394 pixels different)

pointcloud_3d_singlecolor_clipping (testPointCloudSingleColorClipping)

pointcloud_3d_singlecolor_clipping

Test failed at testPointCloudSingleColorClipping at tests/src/3d/testqgspointcloud3drendering.cpp:319

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.

src/3d/qgs3dmapscene.h Outdated Show resolved Hide resolved
src/3d/qgs3dutils.cpp Outdated Show resolved Hide resolved
src/3d/qgs3dutils.cpp Outdated Show resolved Hide resolved
src/3d/qgs3dmapscene.cpp Outdated Show resolved Hide resolved
src/3d/qgs3dmapscene.h Outdated Show resolved Hide resolved
src/3d/qgs3dutils.h Outdated Show resolved Hide resolved
src/3d/qgs3dutils.cpp Outdated Show resolved Hide resolved
src/3d/qgs3dutils.cpp Outdated Show resolved Hide resolved
@ptitjano ptitjano force-pushed the map-clip-planes-compute branch 2 times, most recently from 032b39c to a5312f9 Compare November 19, 2024 18:30
The number of available clip planes depends on the OpenGL
implementation.

This change Introduces a new function in Qgs3DUtils function called
`Qgs3DUtils::getOpenGLMaxClipPlanes` to compute this
number (`GL_MAX_CLIP_PLANES`) and use it in the 3D scene.

See: https://registry.khronos.org/OpenGL-Refpages/gl2.1/xhtml/glClipPlane.xml
@ptitjano
Copy link
Contributor Author

@wonder-sk @uclaros Gentle ping

@wonder-sk wonder-sk merged commit dfce7dc into qgis:master Nov 21, 2024
29 checks passed
@Withalion Withalion mentioned this pull request Nov 24, 2024
2 tasks
@agiudiceandrea
Copy link
Contributor

Hi @ptitjano, may you please have a look at #59577?

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.

6 participants