QGIS API Documentation  3.23.0-Master (b5237dafc3)
qgspostprocessingentity.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgspostprocessingentity.h
3  --------------------------------------
4  Date : August 2020
5  Copyright : (C) 2020 by Belgacem Nedjima
6  Email : gb underscore nedjima at esi dot dz
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSPOSTPROCESSINGENTITY_H
17 #define QGSPOSTPROCESSINGENTITY_H
18 
19 #include <Qt3DCore/QEntity>
20 #include <Qt3DRender/QTexture>
21 #include <Qt3DRender/QMaterial>
22 #include <Qt3DRender/QEffect>
23 #include <Qt3DRender/QCamera>
24 
26 
27 #define SIP_NO_FILE
28 
39 class QgsPostprocessingEntity : public Qt3DCore::QEntity
40 {
41  public:
43  QgsPostprocessingEntity( QgsShadowRenderingFrameGraph *frameGraph, QNode *parent = nullptr );
45  void setupShadowRenderingExtent( float minX, float maxX, float minZ, float maxZ );
47  void setupDirectionalLight( QVector3D position, QVector3D direction );
49  void setShadowRenderingEnabled( bool enabled );
51  void setShadowBias( float shadowBias );
53  void setEyeDomeLightingEnabled( bool enabled );
55  void setEyeDomeLightingStrength( double strength );
57  void setEyeDomeLightingDistance( int distance );
58  private:
59  Qt3DRender::QMaterial *mMaterial = nullptr;
60  Qt3DRender::QEffect *mEffect = nullptr;
61  Qt3DRender::QParameter *mColorTextureParameter = nullptr;
62  Qt3DRender::QParameter *mDepthTextureParameter = nullptr;
63  Qt3DRender::QParameter *mShadowMapParameter = nullptr;
64  Qt3DRender::QCamera *mMainCamera = nullptr;
65  Qt3DRender::QParameter *mFarPlaneParameter = nullptr;
66  Qt3DRender::QParameter *mNearPlaneParameter = nullptr;
67  Qt3DRender::QParameter *mMainCameraInvViewMatrixParameter = nullptr;
68  Qt3DRender::QParameter *mMainCameraInvProjMatrixParameter = nullptr;
69 
70  Qt3DRender::QCamera *mLightCamera = nullptr;
71  Qt3DRender::QParameter *mLightFarPlaneParameter = nullptr;
72  Qt3DRender::QParameter *mLightNearPlaneParameter = nullptr;
73 
74  Qt3DRender::QParameter *mLightPosition = nullptr;
75  Qt3DRender::QParameter *mLightDirection = nullptr;
76 
77  Qt3DRender::QParameter *mShadowMinX = nullptr;
78  Qt3DRender::QParameter *mShadowMaxX = nullptr;
79  Qt3DRender::QParameter *mShadowMinZ = nullptr;
80  Qt3DRender::QParameter *mShadowMaxZ = nullptr;
81 
82  Qt3DRender::QParameter *mRenderShadowsParameter = nullptr;
83  Qt3DRender::QParameter *mShadowBiasParameter = nullptr;
84  Qt3DRender::QParameter *mEyeDomeLightingEnabledParameter = nullptr;
85  Qt3DRender::QParameter *mEyeDomeLightingStrengthParameter = nullptr;
86  Qt3DRender::QParameter *mEyeDomeLightingDistanceParameter = nullptr;
87 };
88 
89 #endif // QGSPOSTPROCESSINGENTITY_H
void setupShadowRenderingExtent(float minX, float maxX, float minZ, float maxZ)
Sets the parts of the scene where objects cast shadows.
QgsPostprocessingEntity(QgsShadowRenderingFrameGraph *frameGraph, QNode *parent=nullptr)
Constructor.
void setShadowRenderingEnabled(bool enabled)
Sets whether shadow rendering is enabled.
void setEyeDomeLightingDistance(int distance)
Sets the eye dome lighting distance (contributes to the contrast of the image)
void setShadowBias(float shadowBias)
Sets the shadow bias value.
void setEyeDomeLightingStrength(double strength)
Sets the eye dome lighting strength.
void setupDirectionalLight(QVector3D position, QVector3D direction)
Sets up a directional light that is used to render shadows.
void setEyeDomeLightingEnabled(bool enabled)
Sets whether eye dome lighting is enabled.