QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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  Q_OBJECT
42 
43  public:
45  QgsPostprocessingEntity( QgsShadowRenderingFrameGraph *frameGraph, QNode *parent = nullptr );
47  void setupShadowRenderingExtent( float minX, float maxX, float minZ, float maxZ );
49  void setupDirectionalLight( QVector3D position, QVector3D direction );
51  void setShadowRenderingEnabled( bool enabled );
53  void setShadowBias( float shadowBias );
55  void setEyeDomeLightingEnabled( bool enabled );
57  void setEyeDomeLightingStrength( double strength );
59  void setEyeDomeLightingDistance( int distance );
60  private:
61  Qt3DRender::QMaterial *mMaterial = nullptr;
62  Qt3DRender::QEffect *mEffect = nullptr;
63  Qt3DRender::QParameter *mColorTextureParameter = nullptr;
64  Qt3DRender::QParameter *mDepthTextureParameter = nullptr;
65  Qt3DRender::QParameter *mShadowMapParameter = nullptr;
66  Qt3DRender::QCamera *mMainCamera = nullptr;
67  Qt3DRender::QParameter *mFarPlaneParameter = nullptr;
68  Qt3DRender::QParameter *mNearPlaneParameter = nullptr;
69  Qt3DRender::QParameter *mMainCameraInvViewMatrixParameter = nullptr;
70  Qt3DRender::QParameter *mMainCameraInvProjMatrixParameter = nullptr;
71 
72  Qt3DRender::QCamera *mLightCamera = nullptr;
73  Qt3DRender::QParameter *mLightFarPlaneParameter = nullptr;
74  Qt3DRender::QParameter *mLightNearPlaneParameter = nullptr;
75 
76  Qt3DRender::QParameter *mLightPosition = nullptr;
77  Qt3DRender::QParameter *mLightDirection = nullptr;
78 
79  Qt3DRender::QParameter *mShadowMinX = nullptr;
80  Qt3DRender::QParameter *mShadowMaxX = nullptr;
81  Qt3DRender::QParameter *mShadowMinZ = nullptr;
82  Qt3DRender::QParameter *mShadowMaxZ = nullptr;
83 
84  Qt3DRender::QParameter *mRenderShadowsParameter = nullptr;
85  Qt3DRender::QParameter *mShadowBiasParameter = nullptr;
86  Qt3DRender::QParameter *mEyeDomeLightingEnabledParameter = nullptr;
87  Qt3DRender::QParameter *mEyeDomeLightingStrengthParameter = nullptr;
88  Qt3DRender::QParameter *mEyeDomeLightingDistanceParameter = nullptr;
89 };
90 
91 #endif // QGSPOSTPROCESSINGENTITY_H
QgsPostprocessingEntity::QgsPostprocessingEntity
QgsPostprocessingEntity(QgsShadowRenderingFrameGraph *frameGraph, QNode *parent=nullptr)
Constructor.
Definition: qgspostprocessingentity.cpp:30
QgsPostprocessingEntity::setEyeDomeLightingStrength
void setEyeDomeLightingStrength(double strength)
Sets the eye dome lighting strength.
Definition: qgspostprocessingentity.cpp:195
QgsPostprocessingEntity::setupDirectionalLight
void setupDirectionalLight(QVector3D position, QVector3D direction)
Sets up a directional light that is used to render shadows.
Definition: qgspostprocessingentity.cpp:174
QgsPostprocessingEntity::setEyeDomeLightingEnabled
void setEyeDomeLightingEnabled(bool enabled)
Sets whether eye dome lighting is enabled.
Definition: qgspostprocessingentity.cpp:190
QgsShadowRenderingFrameGraph
Container class that holds different objects related to shadow rendering.
Definition: qgsshadowrenderingframegraph.h:59
QgsPostprocessingEntity::setupShadowRenderingExtent
void setupShadowRenderingExtent(float minX, float maxX, float minZ, float maxZ)
Sets the parts of the scene where objects cast shadows.
Definition: qgspostprocessingentity.cpp:166
QgsPostprocessingEntity::setShadowBias
void setShadowBias(float shadowBias)
Sets the shadow bias value.
Definition: qgspostprocessingentity.cpp:185
QgsPostprocessingEntity::setShadowRenderingEnabled
void setShadowRenderingEnabled(bool enabled)
Sets whether shadow rendering is enabled.
Definition: qgspostprocessingentity.cpp:180
QgsPostprocessingEntity
An entity that is responsible for applying post processing effect.
Definition: qgspostprocessingentity.h:39
QgsPostprocessingEntity::setEyeDomeLightingDistance
void setEyeDomeLightingDistance(int distance)
Sets the eye dome lighting distance (contributes to the contrast of the image)
Definition: qgspostprocessingentity.cpp:200