diff --git a/python/3d/auto_generated/qgs3dmapsettings.sip.in b/python/3d/auto_generated/qgs3dmapsettings.sip.in index 150145877e0e..4dfc3f20f0cb 100644 --- a/python/3d/auto_generated/qgs3dmapsettings.sip.in +++ b/python/3d/auto_generated/qgs3dmapsettings.sip.in @@ -418,6 +418,10 @@ Returns whether to display labels on terrain tiles void setEyeDomeLightingEnabled( bool enabled ); %Docstring Sets whether eye dome lighting will be used + +.. seealso:: :py:func:`eyeDomeLightingEnabled` + +.. versionadded:: 3.18 %End bool eyeDomeLightingEnabled() const; %Docstring @@ -427,6 +431,10 @@ Returns whether eye dome lighting is used void setEyeDomeLightingStrength( double strength ); %Docstring Sets the eye dome lighting strength value + +.. seealso:: :py:func:`eyeDomeLightingStrength` + +.. versionadded:: 3.18 %End double eyeDomeLightingStrength() const; %Docstring @@ -435,7 +443,11 @@ Returns the eye dome lighting strength value void setEyeDomeLightingDistance( int distance ); %Docstring -Sets the eye dome lighting distance value (contributes to the contrast of the image) +Sets the eye dome lighting distance value (contributes to the contrast of the image + +.. seealso:: :py:func:`eyeDomeLightingDistance` + +.. versionadded:: 3.18 %End int eyeDomeLightingDistance() const; %Docstring diff --git a/src/3d/qgs3dmapsettings.h b/src/3d/qgs3dmapsettings.h index bbd065cd45ea..e06df4b59285 100644 --- a/src/3d/qgs3dmapsettings.h +++ b/src/3d/qgs3dmapsettings.h @@ -362,17 +362,29 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec //! Returns whether to display labels on terrain tiles bool showLabels() const { return mShowLabels; } - //! Sets whether eye dome lighting will be used + /** + * Sets whether eye dome lighting will be used + * \see eyeDomeLightingEnabled() + * \since QGIS 3.18 + */ void setEyeDomeLightingEnabled( bool enabled ); //! Returns whether eye dome lighting is used bool eyeDomeLightingEnabled() const { return mEyeDomeLightingEnabled; } - //! Sets the eye dome lighting strength value + /** + * Sets the eye dome lighting strength value + * \see eyeDomeLightingStrength() + * \since QGIS 3.18 + */ void setEyeDomeLightingStrength( double strength ); //! Returns the eye dome lighting strength value double eyeDomeLightingStrength() const { return mEyeDomeLightingStrength; } - //! Sets the eye dome lighting distance value (contributes to the contrast of the image) + /** + * Sets the eye dome lighting distance value (contributes to the contrast of the image + * \see eyeDomeLightingDistance() + * \since QGIS 3.18 + */ void setEyeDomeLightingDistance( int distance ); //! Returns the eye dome lighting distance value (contributes to the contrast of the image) int eyeDomeLightingDistance() const { return mEyeDomeLightingDistance; } @@ -630,7 +642,7 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject, public QgsTemporalRangeObjec QgsShadowSettings mShadowSettings; //!< Shadow rendering related settings bool mEyeDomeLightingEnabled = false; - double mEyeDomeLightingStrength = 1000.0f; + double mEyeDomeLightingStrength = 1000.0; int mEyeDomeLightingDistance = 1; }; diff --git a/src/3d/qgspostprocessingentity.cpp b/src/3d/qgspostprocessingentity.cpp index 9cdd09001b60..6a3cbf087c5d 100644 --- a/src/3d/qgspostprocessingentity.cpp +++ b/src/3d/qgspostprocessingentity.cpp @@ -200,7 +200,7 @@ void QgsPostprocessingEntity::setEyeDomeLightingStrength( double strength ) mEyeDomeLightingStrengthParameter->setValue( QVariant::fromValue( strength ) ); } -void QgsPostprocessingEntity::setEyeDomeLightingDistance( double distance ) +void QgsPostprocessingEntity::setEyeDomeLightingDistance( int distance ) { mEyeDomeLightingDistanceParameter->setValue( QVariant::fromValue( distance ) ); } diff --git a/src/3d/qgspostprocessingentity.h b/src/3d/qgspostprocessingentity.h index a733761b38db..0662d60464cc 100644 --- a/src/3d/qgspostprocessingentity.h +++ b/src/3d/qgspostprocessingentity.h @@ -53,7 +53,7 @@ class QgsPostprocessingEntity : public Qt3DCore::QEntity //! Sets the eye dome lighting strength void setEyeDomeLightingStrength( double strength ); //! Sets the eye dome lighting distance (contributes to the contrast of the image) - void setEyeDomeLightingDistance( double distance ); + void setEyeDomeLightingDistance( int distance ); private: Qt3DRender::QMaterial *mMaterial = nullptr; Qt3DRender::QEffect *mEffect = nullptr; diff --git a/src/3d/qgsshadowrenderingframegraph.cpp b/src/3d/qgsshadowrenderingframegraph.cpp index 2f529054aa90..361d6389848b 100644 --- a/src/3d/qgsshadowrenderingframegraph.cpp +++ b/src/3d/qgsshadowrenderingframegraph.cpp @@ -343,7 +343,7 @@ void QgsShadowRenderingFrameGraph::setFrustumCullingEnabled( bool enabled ) mFrustumCulling->setParent( ( Qt3DCore::QNode * )nullptr ); } -void QgsShadowRenderingFrameGraph::setupEyeDomeLighting( bool enabled, double strength, double distance ) +void QgsShadowRenderingFrameGraph::setupEyeDomeLighting( bool enabled, double strength, int distance ) { mEyeDomeLightingEnabled = enabled; mEyeDomeLightingStrength = strength; diff --git a/src/3d/qgsshadowrenderingframegraph.h b/src/3d/qgsshadowrenderingframegraph.h index ae2fea7fb7f5..7ff95c54c64b 100644 --- a/src/3d/qgsshadowrenderingframegraph.h +++ b/src/3d/qgsshadowrenderingframegraph.h @@ -117,7 +117,7 @@ class QgsShadowRenderingFrameGraph : public Qt3DCore::QEntity //! Sets shadow rendering to use a directional light void setupDirectionalLight( const QgsDirectionalLightSettings &light, float maximumShadowRenderingDistance ); //! Sets eye dome lighting shading related settings - void setupEyeDomeLighting( bool enabled, double strength, double distance ); + void setupEyeDomeLighting( bool enabled, double strength, int distance ); private: Qt3DRender::QRenderSurfaceSelector *mRenderSurfaceSelector = nullptr; Qt3DRender::QViewport *mMainViewPort = nullptr; @@ -156,8 +156,8 @@ class QgsShadowRenderingFrameGraph : public Qt3DCore::QEntity int mShadowMapResolution = 2048; bool mEyeDomeLightingEnabled = false; - double mEyeDomeLightingStrength = 1000.0f; - double mEyeDomeLightingDistance = 1.0f; + double mEyeDomeLightingStrength = 1000.0; + int mEyeDomeLightingDistance = 1; Qt3DRender::QLayerFilter *mShadowSceneEntitiesFilter = nullptr; Qt3DRender::QRenderStateSet *mShadowRenderStateSet = nullptr; diff --git a/src/3d/shaders/postprocess.frag b/src/3d/shaders/postprocess.frag index 31e5944ce7b7..fdda1a9b31fc 100644 --- a/src/3d/shaders/postprocess.frag +++ b/src/3d/shaders/postprocess.frag @@ -30,7 +30,7 @@ uniform float shadowBias; uniform int edlEnabled; uniform float edlStrength; -uniform float edlDistance; +uniform int edlDistance; in vec2 texCoord;