QGIS API Documentation 4.1.0-Master (26185ffb827)
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
25class QgsFrameGraph;
29class QgsVector3D;
33
34namespace Qt3DRender
35{
36 class QCamera;
37 class QParameter;
38} //namespace Qt3DRender
39
40
50{
51 Q_OBJECT
52
53 public:
55 QgsPostprocessingEntity( QgsFrameGraph *frameGraph, Qt3DRender::QLayer *layer, QNode *parent = nullptr );
56
58 void setShadowRenderingEnabled( bool enabled );
59
65 void setShowCascadingShadowSplits( bool enabled );
66
68 void setShadowLightIndex( int index );
70 void setShadowBias( float shadowBias );
71
76 void updateShadowSettings( const QgsShadowSettings &shadowSettings, const QgsVector3D &lightDir, int size, int globalLightIndex );
77
82 void updateEyeDomeSettings( const Qgs3DMapSettings &settings );
84 void setEyeDomeLightingEnabled( bool enabled );
86 void setEyeDomeLightingStrength( double strength );
88 void setEyeDomeLightingDistance( int distance );
89
94 void setAmbientOcclusionEnabled( bool enabled );
95
100 void updateBloomSettings( const QgsBloomSettings &settings );
101
105 void setBloomEnabled( bool enabled );
106
112 void setBloomFactor( float factor );
113
120
121 private:
122 Qt3DRender::QCamera *mMainCamera = nullptr;
123
124 int mShadowMapResolution = 512;
125
126 Qt3DRender::QParameter *mColorTextureParameter = nullptr;
127 Qt3DRender::QParameter *mDepthTextureParameter = nullptr;
128 Qt3DRender::QParameter *mShadowMapParameter = nullptr;
129 Qt3DRender::QParameter *mAmbientOcclusionTextureParameter = nullptr;
130 Qt3DRender::QParameter *mFarPlaneParameter = nullptr;
131 Qt3DRender::QParameter *mNearPlaneParameter = nullptr;
132 Qt3DRender::QParameter *mMainCameraInvViewMatrixParameter = nullptr;
133 Qt3DRender::QParameter *mMainCameraInvProjMatrixParameter = nullptr;
134
135 Qt3DRender::QParameter *mShadowLightIndexParameter = nullptr;
136 Qt3DRender::QCamera *mLightCameras[Qgs3D::NUM_SHADOW_CASCADES] = { nullptr };
137 Qt3DRender::QParameter *mCsmMatricesParameter = nullptr;
138 Qt3DRender::QParameter *mCsmBoundsMatricesParameter = nullptr;
139 Qt3DRender::QParameter *mMaxShadowDistanceParameter = nullptr;
140
141 Qt3DRender::QParameter *mRenderShadowsParameter = nullptr;
142 Qt3DRender::QParameter *mShadowBiasParameter = nullptr;
143 Qt3DRender::QParameter *mEyeDomeLightingEnabledParameter = nullptr;
144 Qt3DRender::QParameter *mEyeDomeLightingStrengthParameter = nullptr;
145 Qt3DRender::QParameter *mEyeDomeLightingDistanceParameter = nullptr;
146
147 Qt3DRender::QParameter *mAmbientOcclusionEnabledParameter = nullptr;
148
149 Qt3DRender::QParameter *mBloomTextureParameter = nullptr;
150 Qt3DRender::QParameter *mBloomEnabledParameter = nullptr;
151 Qt3DRender::QParameter *mBloomFactorParameter = nullptr;
152
153 Qt3DRender::QParameter *mExposureParameter = nullptr;
154 Qt3DRender::QParameter *mToneMappingParameter = nullptr;
155};
156
157#endif // QGSPOSTPROCESSINGENTITY_H
Definition of the world.
static constexpr int NUM_SHADOW_CASCADES
Number of shadow map cascades.
Definition qgs3d.h:104
Contains the configuration of the lighting "bloom" effect.
Contains the configuration of the scene's color grading settings, such as exposure and tone mapping.
Definition of a directional light in a 3D map scene.
Container class that holds different objects related to frame graphs of 3D scenes.
void updateShadowSettings(const QgsShadowSettings &shadowSettings, const QgsVector3D &lightDir, int size, int globalLightIndex)
Sets shadow rendering to use a directional light.
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 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 updateEyeDomeSettings(const Qgs3DMapSettings &settings)
Updates eye dome lighting settings from settings.
void setBloomFactor(float factor)
Sets the bloom factor, which controls the strength of the bloom effect.
void updateBloomSettings(const QgsBloomSettings &settings)
Sets bloom rendering to use a directional light.
void setEyeDomeLightingEnabled(bool enabled)
Sets whether eye dome lighting is enabled.
void updateColorGradingSettings(const QgsColorGradingSettings &settings)
Updates settings for color grading.
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.
Contains configuration for rendering shadows.
A 3D vector (similar to QVector3D) with the difference that it uses double precision instead of singl...
Definition qgsvector3d.h:33