Skip to content

Commit

Permalink
address reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
NEDJIMAbelgacem authored and wonder-sk committed Nov 6, 2020
1 parent 8768b7e commit e9ac731
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 12 deletions.
14 changes: 13 additions & 1 deletion python/3d/auto_generated/qgs3dmapsettings.sip.in
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
20 changes: 16 additions & 4 deletions src/3d/qgs3dmapsettings.h
Expand Up @@ -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; }
Expand Down Expand Up @@ -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;
};

Expand Down
2 changes: 1 addition & 1 deletion src/3d/qgspostprocessingentity.cpp
Expand Up @@ -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 ) );
}
2 changes: 1 addition & 1 deletion src/3d/qgspostprocessingentity.h
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/3d/qgsshadowrenderingframegraph.cpp
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/3d/qgsshadowrenderingframegraph.h
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/3d/shaders/postprocess.frag
Expand Up @@ -30,7 +30,7 @@ uniform float shadowBias;

uniform int edlEnabled;
uniform float edlStrength;
uniform float edlDistance;
uniform int edlDistance;

in vec2 texCoord;

Expand Down

0 comments on commit e9ac731

Please sign in to comment.