72 Commits

Author SHA1 Message Date
Nyall Dawson
746ee315bd Fix boolean literal presentation in dox/PyQGIS docs 2020-10-16 16:03:26 +10:00
Nedjima Belgacem
85e444e1d6
[3D] [Feature] Shadow rendering (#38448)
* Initial post processing render pass implementation

* Got shadows with directional lights working good enough

* Make the shadows more configurable

* Trying to reduce peter panning

* Add licence

* banned banned_keywords_check

* trying to remove renderStateSet memory leak

* removing include <Qt3DExtras>

* Add documentation

* remove the use of setFilterMode when using QFilterLayer

* Fixing docs

* Fix shadow rendering checkbox

* Added y coordinates for view extent

* Added shadow bias parameter

* Added shadow map texture resolution parameter

* Addressing reviews

* Set the shadow rendering parameters automatically

* Add QLayer components individually if QT_VERSION < QT_5_10

* Hide depth texture preview quad

* Remove unused member

* Fix spell check

* Remove stepType property from shadowBiasSpinBox

* Disable shadow render pass if the shadow rendering is not activated

* Clarify maximum shadow rendering distance documentation

* Add value range for shadow bias

* Delete .bom file

* Clarify the usefullness of maximum shadow rendering distance

* remove unused stuff in shaders

* Make the inverted camera matrices passed as parameters

* Move post processing shaders parameters into the post processing entity constructor

* refactor how shadow rendering update into 1 function

* Fix spelling

* Fix Save As Image tool

* Improve UI according to suggessions

* add missing docs

* remove QAbstractSpinBox::DefaultStepType
2020-09-10 15:02:03 +02:00
Nyall Dawson
d1bc82ca7b Misc typo fixes 2020-08-31 11:38:02 +10:00
Harrissou Sant-anna
09844a7dab Move the skybox enabling checkbox to the groupbox widget
Whether skybox is enabled is now saved as part of the 3D Map settings
2020-08-21 13:00:52 +10:00
Nyall Dawson
23848e0e89 Start cleaning up label line settings, by moving them from the
QgsPalLayerSettings mega class to a dedicated QgsLabelLineSettings
class
2020-08-17 11:12:33 +10:00
NEDJIMAbelgacem
d7787f2477 Use path resolver's read/writePath()
Remove QSkyboxEntity include
Use deleteLater() instead of delete
Remove unneeded todo
Add \since to skyboxSettings in qgs3dmapsettings.h
2020-08-06 01:09:20 +01:00
NEDJIMAbelgacem
58d280be60 Fix merge conflict
Merge branch 'master' into skybox-feature
2020-08-04 08:33:53 +01:00
NEDJIMAbelgacem
4ac66d08c8 Add SIP_NO_FILE and fix bindings 2020-08-04 07:07:51 +01:00
Nyall Dawson
53a8343eac Fix see also 2020-08-03 16:34:10 +10:00
Nyall Dawson
cafa347441 Add sip casting code for material types 2020-08-03 16:34:10 +10:00
Nyall Dawson
b07e0a20d0 Split textured phong material class from basic phong material class 2020-08-03 16:34:10 +10:00
Nyall Dawson
4d5518531f Split simple line material out from phong material 2020-08-03 16:34:10 +10:00
Nyall Dawson
c87a8f6afb Code shuffle to move all material classes to separate subdirectory 2020-08-03 16:34:10 +10:00
Nyall Dawson
798ed57155 Rename terrain texture for clarity 2020-08-03 16:34:10 +10:00
Nyall Dawson
7c08046a47 Don't show texture controls in terrain shading widget 2020-08-03 16:34:10 +10:00
Nyall Dawson
2455170df1 Fix broken see also link 2020-08-03 16:34:10 +10:00
Nyall Dawson
ada2c601fb Move some texture handling methods to base class 2020-08-03 16:34:10 +10:00
Nyall Dawson
b9a147659f Fix sipifaction of enum class 2020-08-03 16:34:10 +10:00
Nyall Dawson
51cde6fbd2 [3d][FEATURE] Add CAD style ("Gooch") material for polygons/extruded lines
From the qt docs:

"The Gooch lighting model uses both color and brightness to help show the
curvature of 3D surfaces. This is often better than models such as Phong
that rely purely upon changes in brightness. In situations such as in CAD
and CAM applications where photorealism is not a goal, the Gooch shading
model in conjunction with some kind of silhouette edge inking is a popular
solution.

The Gooch lighting model is explained fully in the original Gooch paper.
The Gooch model mixes a diffuse object color with a user-provided cool
color and warm color to produce the end points of a color ramp that is
used to shade the object based upon the cosine of the angle between the
vector from the fragment to the light source and the fragment's normal
vector. Optionally, a specular highlight can be added on top. The
relative contributions to the cool and warm colors by the diffuse color
are controlled by the alpha and beta properties respecitvely."""

The TLDR: the shader works well for revealing 3d details of objects
which may otherwise be hidden due to the scene's lighting. Ultimately,
it's an easier material to work with as you don't need to worry
about setting up appropriate scene lighting in order to visualise features.
2020-08-03 16:34:10 +10:00
Nyall Dawson
daf38a9f23 Rework QgsAbstractMaterialSettings class to handle different rendering techniques
Restrict choice of material in widgets based on the symbol's required technique,
and hide material settings in phong widget which don't apply to certain
rendering techniques (e.g. hiding all but the ambient color for simple 3d line
symbols)
2020-08-03 16:34:10 +10:00
Nyall Dawson
d85228654b Add an icon in the 3d material combo box 2020-08-03 16:34:10 +10:00
Nyall Dawson
4f34b8a7f8 [3d][api] Split api from specifying 3d map layers to render from api
for specifying terrain layers to render

Previously the one method was used for both, which made it very
difficult to have a different set of layers used for terrain
generation vs 3d entity generation (you had to manually create a map
theme, which is very messy)
2020-08-03 13:13:11 +10:00
NEDJIMAbelgacem
8501959150 Fix merge conflict 2020-08-02 05:38:12 +01:00
NEDJIMAbelgacem
7746575ccb Merge branch 'master' into skybox-feature 2020-08-02 04:03:46 +01:00
NEDJIMAbelgacem
b39547e508 Delete previous skybox implementation and save skybox settings as a DOM element 2020-08-02 00:31:41 +01:00
NEDJIMAbelgacem
f5726e52d5 skybox settings UI 2020-08-01 23:50:25 +01:00
Martin Dobias
836666e782
Merge pull request #37588 from NEDJIMAbelgacem/export-scene-feature
[Feature] Export 3D scene feature
2020-07-30 09:32:15 +02:00
Nyall Dawson
93022ea707 Add method to determine compatible vector layer types for a 3d symbol 2020-07-29 10:27:17 +10:00
NEDJIMAbelgacem
7c37c22ec1 Merge master and fix merge conflict 2020-07-28 18:00:20 +01:00
NEDJIMAbelgacem
750f21d467 Add SIP_SKIP to QgsPolygon3DSymbol::exportGeometries and its overloads 2020-07-28 17:07:23 +01:00
Nyall Dawson
beece1635d Start generalizing material widget handling 2020-07-28 20:45:50 +10:00
Nyall Dawson
e541fe68d7 Correctly restore materials using registry 2020-07-28 20:45:50 +10:00
Nyall Dawson
d579d67a4a [3d] Add a registry for 3d material settings 2020-07-28 20:45:50 +10:00
NEDJIMAbelgacem
a656da3b75 Moved finding geometries from parseVectorLayerEntity to each symbol class 2020-07-28 01:45:11 +01:00
NEDJIMAbelgacem
860be14c32 add SIP_FACTO to QgsAbstractMaterialSettings::toExportParameters 2020-07-25 21:51:59 +01:00
Nyall Dawson
f2e4ac606e [3d] Abstract out material settings
Opens the possibilities for non-phong based materials for 3d symbols
2020-07-24 16:28:18 +10:00
Nyall Dawson
0528fe284c Populate 3D symbol registry, and use to create symbols 2020-07-23 07:53:20 +10:00
Nyall Dawson
c7b6a115df Better initialization of 3d framework, usable outside of app 2020-07-23 07:53:20 +10:00
Nyall Dawson
f60b79fcea Move QgsAbstract3DSymbol to core 2020-07-23 07:53:20 +10:00
Nyall Dawson
573ace14bf [3d][feature] Add option to show light source origins
If enabled, shows a sphere at light source origins, allowing easier repositioning
and placement of light sources relative to the scene contents

Fixes #37726
2020-07-16 07:52:12 +10:00
Nyall Dawson
bf7d746ae4 [api] Add a Qgs3D singleton object, designed to collect other singleton-ish
objects in a central place

Copying the pattern setup by the QgsGui singleton container
2020-07-15 16:10:25 +10:00
Nyall Dawson
b6a9cced10 Dox 2020-07-10 15:46:42 +10:00
Nyall Dawson
eff171ad6d Cleanup diffuse texture API
Seperate the calls for whether a user has enabled diffuse texture
from API for determining whether diffuse texture should be used during
rendering. And don't try to use diffuse textures when the texture
path hasn't yet been set, which causes a flood of Qt warnings...
2020-07-10 15:46:42 +10:00
Nyall Dawson
402ce03763 Minor code cleanup 2020-07-10 15:46:42 +10:00
Nedjima Belgacem
cc96e9e1c1
[Feature] texturing support for vector layer (#36981)
* [Feature] texturing support for vector layer

* Fixed tesselation test not passing issue

* Fixed diffuse_texture_path typo

* Refactoring according to code review

* [Bugfix] the texture coordinates are not setup properly for certain walls

* Added seperation between roofs and walls

* [Feature] texture coordinates rotation

* took back the seperation of texture rotation between walls and roofs because the user will be specifying them with different symbols anyway

* Fixed docs test not passing issue

* Fixed compilation problem

* Fixed compilation problem

* Executed sipify_all trying to fix test not passing issue

* [ui] Harmonize play button across the board

* [ui] Better network logger icon

* [ui] Harmonize loop widget of 3D map view

* [ui] Add a record icon and use it in the network logger panel

* [ui] Move icon-less network logger toolbar actions under settings menu

* [ui] Reflect playback stay in the 3D map view's play button

* Fix azure

* Use prefix increment operator to fix cppcheck warnings related to postfixOperator

* [afs] Read field aliases from layer definition

* Fix ui build warning

* [FEATURE][processing] Add modeler algorithm to set a project expression variable

Allows a model to set Project-level expression variables during execution. Especially
useful with the new Export Print Layout algorithms to allow models which dynamically set variables
used in a layout prior to export.

* Add test

* Refactoring according to code review

Co-authored-by: nirvn <nirvn.asia@gmail.com>
Co-authored-by: Even Rouault <even.rouault@spatialys.com>
Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
2020-07-09 21:12:49 +02:00
Nyall Dawson
5b85cb93c1 Sipify 2020-06-30 12:07:21 +10:00
nedjima
7d8a03b1fe Executed sipify_all script to fix the setDirectionalLights header definition 2020-06-20 04:31:10 +10:00
nedjima
9556bd2147 [Feature] directional lights support for QGIS 3D 2020-06-20 04:31:10 +10:00
Nyall Dawson
81a9db9f57 [sipify] Fix creation of cross references 2020-06-15 13:43:58 +10:00
Nyall Dawson
c795ddb1e9 Updates 2020-06-11 13:29:59 +10:00