QGIS API Documentation 4.1.0-Master (31622b25bb0)
Loading...
Searching...
No Matches
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 "qgs3d.h"
20#include "qgsrenderpassquad.h"
21
22#define SIP_NO_FILE
23
24class QgsFrameGraph;
27
28namespace Qt3DRender
29{
30 class QCamera;
31 class QParameter;
32} //namespace Qt3DRender
33
34
44{
45 Q_OBJECT
46
47 public:
49 QgsPostprocessingEntity( QgsFrameGraph *frameGraph, Qt3DRender::QLayer *layer, QNode *parent = nullptr );
51 void setShadowRenderingEnabled( bool enabled );
52
58 void setShowCascadingShadowSplits( bool enabled );
59
61 void setShadowLightIndex( int index );
63 void setShadowBias( float shadowBias );
64
66 void setShadowMapResolution( int resolution );
67
69 void setEyeDomeLightingEnabled( bool enabled );
71 void setEyeDomeLightingStrength( double strength );
73 void setEyeDomeLightingDistance( int distance );
74
79 void updateShadowSettings( const QgsDirectionalLightSettings &light, float maximumShadowRenderingDistance );
80
85 void setAmbientOcclusionEnabled( bool enabled );
86
90 void setBloomEnabled( bool enabled );
91
97 void setBloomFactor( float factor );
98
99 private:
100 Qt3DRender::QCamera *mMainCamera = nullptr;
101
102 int mShadowMapResolution = 512;
103
104 Qt3DRender::QParameter *mColorTextureParameter = nullptr;
105 Qt3DRender::QParameter *mDepthTextureParameter = nullptr;
106 Qt3DRender::QParameter *mShadowMapParameter = nullptr;
107 Qt3DRender::QParameter *mAmbientOcclusionTextureParameter = nullptr;
108 Qt3DRender::QParameter *mFarPlaneParameter = nullptr;
109 Qt3DRender::QParameter *mNearPlaneParameter = nullptr;
110 Qt3DRender::QParameter *mMainCameraInvViewMatrixParameter = nullptr;
111 Qt3DRender::QParameter *mMainCameraInvProjMatrixParameter = nullptr;
112
113 Qt3DRender::QParameter *mShadowLightIndexParameter = nullptr;
114 Qt3DRender::QCamera *mLightCameras[Qgs3D::NUM_SHADOW_CASCADES] = { nullptr };
115 Qt3DRender::QParameter *mCsmMatricesParameter = nullptr;
116 Qt3DRender::QParameter *mCsmBoundsMatricesParameter = nullptr;
117 Qt3DRender::QParameter *mMaxShadowDistanceParameter = nullptr;
118
119 Qt3DRender::QParameter *mRenderShadowsParameter = nullptr;
120 Qt3DRender::QParameter *mShadowBiasParameter = nullptr;
121 Qt3DRender::QParameter *mEyeDomeLightingEnabledParameter = nullptr;
122 Qt3DRender::QParameter *mEyeDomeLightingStrengthParameter = nullptr;
123 Qt3DRender::QParameter *mEyeDomeLightingDistanceParameter = nullptr;
124
125 Qt3DRender::QParameter *mAmbientOcclusionEnabledParameter = nullptr;
126
127 Qt3DRender::QParameter *mBloomTextureParameter = nullptr;
128 Qt3DRender::QParameter *mBloomEnabledParameter = nullptr;
129 Qt3DRender::QParameter *mBloomFactorParameter = nullptr;
130};
131
132#endif // QGSPOSTPROCESSINGENTITY_H
static constexpr int NUM_SHADOW_CASCADES
Number of shadow map cascades.
Definition qgs3d.h:104
Definition of a directional light in a 3D map scene.
Container class that holds different objects related to frame graphs of 3D scenes.
void setShowCascadingShadowSplits(bool enabled)
Sets whether the splits between cascading shadow map boundaries should be shown.
void setAmbientOcclusionEnabled(bool enabled)
Sets whether screen space ambient occlusion is enabled.
void setShadowRenderingEnabled(bool enabled)
Sets whether shadow rendering is enabled.
void setShadowLightIndex(int index)
Sets the index of the directional light that is casting shadows.
void setBloomEnabled(bool enabled)
Sets whether physically based bloom is enabled.
void updateShadowSettings(const QgsDirectionalLightSettings &light, float maximumShadowRenderingDistance)
Sets shadow rendering to use a directional light.
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 setShadowMapResolution(int resolution)
Sets the shadow texture map resolution.
void setBloomFactor(float factor)
Sets the bloom factor, which controls the strength of the bloom effect.
void setEyeDomeLightingEnabled(bool enabled)
Sets whether eye dome lighting is enabled.
QgsPostprocessingEntity(QgsFrameGraph *frameGraph, Qt3DRender::QLayer *layer, QNode *parent=nullptr)
Constructor.
QgsRenderPassQuad(Qt3DRender::QLayer *layer, QNode *parent=nullptr)
Constructor.
Container class that holds different objects related to shadow rendering.