-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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] Use QGIS material for the terrain #58134
Conversation
Tests failed for Qt 5One or more tests failed using the build from commit 5a80cbe flat_terrain_1 (testFlatTerrain)flat_terrain_1Test failed at testFlatTerrain at tests/src/3d/testqgs3drendering.cpp:293
dem_terrain_1 (testDemTerrain)dem_terrain_1Test failed at testDemTerrain at tests/src/3d/testqgs3drendering.cpp:345 Rendered image did not match tests/testdata/control_images/3d/expected_dem_terrain_1/expected_dem_terrain_1.png (found 210358 pixels different) polygon3d_extrusion (testExtrudedPolygons)polygon3d_extrusionTest failed at testExtrudedPolygons at tests/src/3d/testqgs3drendering.cpp:421 Rendered image did not match tests/testdata/control_images/3d/expected_polygon3d_extrusion/expected_polygon3d_extrusion.png (found 270865 pixels different) polygon3d_extrusion_data_defined_phong (testExtrudedPolygonsDataDefinedPhong)polygon3d_extrusion_data_defined_phongTest failed at testExtrudedPolygonsDataDefinedPhong at tests/src/3d/testqgs3drendering.cpp:539 Rendered image did not match tests/testdata/control_images/3d/expected_polygon3d_extrusion_data_defined_phong/expected_polygon3d_extrusion_data_defined_phong.png (found 270870 pixels different) polygon3d_extrusion_data_defined_gooch (testExtrudedPolygonsDataDefinedGooch)polygon3d_extrusion_data_defined_goochTest failed at testExtrudedPolygonsDataDefinedGooch at tests/src/3d/testqgs3drendering.cpp:595 Rendered image did not match tests/testdata/control_images/3d/expected_polygon3d_extrusion_data_defined_gooch/expected_polygon3d_extrusion_data_defined_gooch.png (found 270886 pixels different) polygon3d_extrusion_gooch_shading (testExtrudedPolygonsGoochShading)polygon3d_extrusion_gooch_shadingTest failed at testExtrudedPolygonsGoochShading at tests/src/3d/testqgs3drendering.cpp:641
terrain_theme (testMapTheme)terrain_themeTest failed at testMapTheme at tests/src/3d/testqgs3drendering.cpp:1041
flat_terrain_filtered_1 (testFilteredFlatTerrain)flat_terrain_filtered_1Test failed at testFilteredFlatTerrain at tests/src/3d/testqgs3drendering.cpp:1423
dem_terrain_filtered_1 (testFilteredDemTerrain)dem_terrain_filtered_1Test failed at testFilteredDemTerrain at tests/src/3d/testqgs3drendering.cpp:1468 Rendered image did not match tests/testdata/control_images/3d/expected_dem_terrain_filtered_1/expected_dem_terrain_filtered_1.png (found 52451 pixels different) polygon3d_extrusion_filtered (testFilteredExtrudedPolygons)polygon3d_extrusion_filteredTest failed at testFilteredExtrudedPolygons at tests/src/3d/testqgs3drendering.cpp:1525 Rendered image did not match tests/testdata/control_images/3d/expected_polygon3d_extrusion_filtered/expected_polygon3d_extrusion_filtered.png (found 53882 pixels different) ambient_occlusion_1 (testAmbientOcclusion)ambient_occlusion_1Test failed at testAmbientOcclusion at tests/src/3d/testqgs3drendering.cpp:1576 Rendered image did not match tests/testdata/control_images/3d/expected_ambient_occlusion_1/expected_ambient_occlusion_1.png (found 23975 pixels different) debug_map_1 (testDebugMap)debug_map_1Test failed at testDebugMap at tests/src/3d/testqgs3drendering.cpp:1779 Rendered image did not match tests/testdata/control_images/3d/expected_debug_map_1/expected_debug_map_1.png (found 239452 pixels different) composer3d_basic_qt5 (testBasic)composer3d_basic_qt5Test failed at testBasic at tests/src/3d/testqgslayout3dmap.cpp:107 Rendered image did not match tests/testdata/control_images/composer_3d/expected_composer3d_basic_qt5/expected_composer3d_basic_qt5.png (found 443995 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. |
Tests failed for Qt 6One or more tests failed using the build from commit 5a80cbe flat_terrain_1 (testFlatTerrain)flat_terrain_1Test failed at testFlatTerrain at tests/src/3d/testqgs3drendering.cpp:293
dem_terrain_1 (testDemTerrain)dem_terrain_1Test failed at testDemTerrain at tests/src/3d/testqgs3drendering.cpp:345 Rendered image did not match tests/testdata/control_images/3d/expected_dem_terrain_1/expected_dem_terrain_1.png (found 210364 pixels different) polygon3d_extrusion (testExtrudedPolygons)polygon3d_extrusionTest failed at testExtrudedPolygons at tests/src/3d/testqgs3drendering.cpp:421 Rendered image did not match tests/testdata/control_images/3d/expected_polygon3d_extrusion/expected_polygon3d_extrusion.png (found 270867 pixels different) polygon3d_extrusion_data_defined_phong (testExtrudedPolygonsDataDefinedPhong)polygon3d_extrusion_data_defined_phongTest failed at testExtrudedPolygonsDataDefinedPhong at tests/src/3d/testqgs3drendering.cpp:539 Rendered image did not match tests/testdata/control_images/3d/expected_polygon3d_extrusion_data_defined_phong/expected_polygon3d_extrusion_data_defined_phong.png (found 270856 pixels different) polygon3d_extrusion_data_defined_gooch (testExtrudedPolygonsDataDefinedGooch)polygon3d_extrusion_data_defined_goochTest failed at testExtrudedPolygonsDataDefinedGooch at tests/src/3d/testqgs3drendering.cpp:595 Rendered image did not match tests/testdata/control_images/3d/expected_polygon3d_extrusion_data_defined_gooch/expected_polygon3d_extrusion_data_defined_gooch.png (found 270876 pixels different) polygon3d_extrusion_gooch_shading (testExtrudedPolygonsGoochShading)polygon3d_extrusion_gooch_shadingTest failed at testExtrudedPolygonsGoochShading at tests/src/3d/testqgs3drendering.cpp:641
terrain_theme (testMapTheme)terrain_themeTest failed at testMapTheme at tests/src/3d/testqgs3drendering.cpp:1041
flat_terrain_filtered_1 (testFilteredFlatTerrain)flat_terrain_filtered_1Test failed at testFilteredFlatTerrain at tests/src/3d/testqgs3drendering.cpp:1423
dem_terrain_filtered_1 (testFilteredDemTerrain)dem_terrain_filtered_1Test failed at testFilteredDemTerrain at tests/src/3d/testqgs3drendering.cpp:1468 Rendered image did not match tests/testdata/control_images/3d/expected_dem_terrain_filtered_1/expected_dem_terrain_filtered_1.png (found 52451 pixels different) polygon3d_extrusion_filtered (testFilteredExtrudedPolygons)polygon3d_extrusion_filteredTest failed at testFilteredExtrudedPolygons at tests/src/3d/testqgs3drendering.cpp:1525 Rendered image did not match tests/testdata/control_images/3d/expected_polygon3d_extrusion_filtered/expected_polygon3d_extrusion_filtered.png (found 53882 pixels different) ambient_occlusion_1 (testAmbientOcclusion)ambient_occlusion_1Test failed at testAmbientOcclusion at tests/src/3d/testqgs3drendering.cpp:1576 Rendered image did not match tests/testdata/control_images/3d/expected_ambient_occlusion_1/expected_ambient_occlusion_1.png (found 23978 pixels different) debug_map_1 (testDebugMap)debug_map_1Test failed at testDebugMap at tests/src/3d/testqgs3drendering.cpp:1779 Rendered image did not match tests/testdata/control_images/3d/expected_debug_map_1/expected_debug_map_1.png (found 239471 pixels different) composer3d_basic_qt6 (testBasic)composer3d_basic_qt6Test failed at testBasic at tests/src/3d/testqgslayout3dmap.cpp:109 Rendered image did not match tests/testdata/control_images/composer_3d/expected_composer3d_basic_qt6/expected_composer3d_basic_qt6.png (found 444131 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. |
3ef1853
to
b292e94
Compare
python/3d/auto_generated/materials/qgsphongmaterialsettings.sip.in
Outdated
Show resolved
Hide resolved
python/3d/auto_generated/materials/qgsphongtexturedmaterialsettings.sip.in
Outdated
Show resolved
Hide resolved
python/3d/auto_generated/materials/qgsphongtexturedmaterialsettings.sip.in
Outdated
Show resolved
Hide resolved
6494e5d
to
9664e26
Compare
There is no functional change. With this change, the terrain uses a material defined by QGIS instead of a default Qt3D. This will make it easier to customize the shader in the future.
`mShininess` is a double.
This is already waht QgsPhongTexturedMaterialSettings does. The reason for this change is to avoid the user-set values changing for them when saving/restoring projects.
This is already waht QgsPhongTexturedMaterialSettings does. The reason for this change is to avoid the user-set values changing for them when saving/restoring projects.
14446d6
to
f192260
Compare
5f4552d
to
4655e3a
Compare
4655e3a
to
b5b6c70
Compare
This introduces a new class `QgsPhongTexturedMaterial` which is similar to Qt3D `QDiffuseSpecularMaterial`. `QgsPhongTexturedMaterial::toMaterial()` now calls `QgsPhongTexturedMaterial` to create the material. This has no functional change. This will make it possible to directly use `QgsPhongTexturedMaterial` for the terrain in the next commit. Indeed, the texture case needs to use a `QTexture2D` which cannot be stored in a settings class. This issue is avoided by directly creating the material instead of using `QgsPhongTexturedMaterial::toMaterial()`.
There is no functional change. With this change, the terrain uses a material defined by QGIS instead of a default Qt3D. This will make it easier to customize the shader in the future.
b5b6c70
to
58f6025
Compare
58f6025
to
19b04a3
Compare
19b04a3
to
5a80cbe
Compare
This is the same material as the qt3d one: `Qt3DExtras::QTextureMaterial`. It will also be used in the following commit by the terrain.
There is no functional change. With this change, the terrain uses a material defined by QGIS instead of a default Qt3D. This will make it easier to customize the shader in the future.
5a80cbe
to
50baf0a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 looks good to me, thanks for the updates!
Thanks for the review. |
Description
This is factored out from #57899
It allows to use QGIS material for the terrain instead of native qt3D ones. It will make it possible to customize those shaders. There are 3 different cases to handle:
QgsPhongMaterialSettings
QgsPhongTexturedMaterialSettings
is extended to handle both textures and textures from a pathQgsTextureMaterial
This PR needs #58114 to be merged first and thus it includes it.