QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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 
38 class QgsPostprocessingEntity : public Qt3DCore::QEntity
39 {
40  public:
42  QgsPostprocessingEntity( QgsShadowRenderingFrameGraph *frameGraph, QNode *parent = nullptr );
44  void setupShadowRenderingExtent( float minX, float maxX, float minZ, float maxZ );
46  void setupDirectionalLight( QVector3D position, QVector3D direction );
48  void setShadowRenderingEnabled( bool enabled );
50  void setShadowBias( float shadowBias );
51  private:
52  Qt3DRender::QMaterial *mMaterial = nullptr;
53  Qt3DRender::QEffect *mEffect = nullptr;
54  Qt3DRender::QParameter *mColorTextureParameter = nullptr;
55  Qt3DRender::QParameter *mDepthTextureParameter = nullptr;
56  Qt3DRender::QParameter *mShadowMapParameter = nullptr;
57  Qt3DRender::QCamera *mMainCamera = nullptr;
58  Qt3DRender::QParameter *mFarPlaneParameter = nullptr;
59  Qt3DRender::QParameter *mNearPlaneParameter = nullptr;
60  Qt3DRender::QParameter *mMainCameraInvViewMatrixParameter = nullptr;
61  Qt3DRender::QParameter *mMainCameraInvProjMatrixParameter = nullptr;
62 
63  Qt3DRender::QCamera *mLightCamera = nullptr;
64  Qt3DRender::QParameter *mLightFarPlaneParameter = nullptr;
65  Qt3DRender::QParameter *mLightNearPlaneParameter = nullptr;
66 
67  Qt3DRender::QParameter *mLightPosition = nullptr;
68  Qt3DRender::QParameter *mLightDirection = nullptr;
69 
70  Qt3DRender::QParameter *mShadowMinX = nullptr;
71  Qt3DRender::QParameter *mShadowMaxX = nullptr;
72  Qt3DRender::QParameter *mShadowMinZ = nullptr;
73  Qt3DRender::QParameter *mShadowMaxZ = nullptr;
74 
75  Qt3DRender::QParameter *mRenderShadowsParameter = nullptr;
76  Qt3DRender::QParameter *mShadowBiasParameter = nullptr;
77 };
78 
79 #endif // QGSPOSTPROCESSINGENTITY_H
QgsPostprocessingEntity::QgsPostprocessingEntity
QgsPostprocessingEntity(QgsShadowRenderingFrameGraph *frameGraph, QNode *parent=nullptr)
Constructor.
Definition: qgspostprocessingentity.cpp:29
QgsPostprocessingEntity::setupDirectionalLight
void setupDirectionalLight(QVector3D position, QVector3D direction)
Sets up a directional light that is used to render shadows.
Definition: qgspostprocessingentity.cpp:168
QgsShadowRenderingFrameGraph
3 Container class that holds different objects related to shadow rendering
Definition: qgsshadowrenderingframegraph.h:57
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:160
QgsPostprocessingEntity::setShadowBias
void setShadowBias(float shadowBias)
Sets the shadow bias value.
Definition: qgspostprocessingentity.cpp:179
QgsPostprocessingEntity::setShadowRenderingEnabled
void setShadowRenderingEnabled(bool enabled)
Sets whether shadow rendering is enabled.
Definition: qgspostprocessingentity.cpp:174
QgsPostprocessingEntity
3 An entity that is responsible for applying post processing effect Now it is used to make shadows
Definition: qgspostprocessingentity.h:39