QGIS API Documentation 4.1.0-Master (ca2ac17535b)
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;
28class QgsVector3D;
29
30namespace Qt3DRender
31{
32 class QCamera;
33 class QParameter;
34} //namespace Qt3DRender
35
36
46{
47 Q_OBJECT
48
49 public:
51 QgsPostprocessingEntity( QgsFrameGraph *frameGraph, Qt3DRender::QLayer *layer, QNode *parent = nullptr );
53 void setShadowRenderingEnabled( bool enabled );
54
60 void setShowCascadingShadowSplits( bool enabled );
61
63 void setShadowLightIndex( int index );
65 void setShadowBias( float shadowBias );
66
68 void setShadowMapResolution( int resolution );
69
71 void setEyeDomeLightingEnabled( bool enabled );
73 void setEyeDomeLightingStrength( double strength );
75 void setEyeDomeLightingDistance( int distance );
76
81 void updateShadowSettings( const QgsVector3D &lightDirection, float maximumShadowRenderingDistance );
82
87 void setAmbientOcclusionEnabled( bool enabled );
88
92 void setBloomEnabled( bool enabled );
93
99 void setBloomFactor( float factor );
100
107
108 private:
109 Qt3DRender::QCamera *mMainCamera = nullptr;
110
111 int mShadowMapResolution = 512;
112
113 Qt3DRender::QParameter *mColorTextureParameter = nullptr;
114 Qt3DRender::QParameter *mDepthTextureParameter = nullptr;
115 Qt3DRender::QParameter *mShadowMapParameter = nullptr;
116 Qt3DRender::QParameter *mAmbientOcclusionTextureParameter = nullptr;
117 Qt3DRender::QParameter *mFarPlaneParameter = nullptr;
118 Qt3DRender::QParameter *mNearPlaneParameter = nullptr;
119 Qt3DRender::QParameter *mMainCameraInvViewMatrixParameter = nullptr;
120 Qt3DRender::QParameter *mMainCameraInvProjMatrixParameter = nullptr;
121
122 Qt3DRender::QParameter *mShadowLightIndexParameter = nullptr;
123 Qt3DRender::QCamera *mLightCameras[Qgs3D::NUM_SHADOW_CASCADES] = { nullptr };
124 Qt3DRender::QParameter *mCsmMatricesParameter = nullptr;
125 Qt3DRender::QParameter *mCsmBoundsMatricesParameter = nullptr;
126 Qt3DRender::QParameter *mMaxShadowDistanceParameter = nullptr;
127
128 Qt3DRender::QParameter *mRenderShadowsParameter = nullptr;
129 Qt3DRender::QParameter *mShadowBiasParameter = nullptr;
130 Qt3DRender::QParameter *mEyeDomeLightingEnabledParameter = nullptr;
131 Qt3DRender::QParameter *mEyeDomeLightingStrengthParameter = nullptr;
132 Qt3DRender::QParameter *mEyeDomeLightingDistanceParameter = nullptr;
133
134 Qt3DRender::QParameter *mAmbientOcclusionEnabledParameter = nullptr;
135
136 Qt3DRender::QParameter *mBloomTextureParameter = nullptr;
137 Qt3DRender::QParameter *mBloomEnabledParameter = nullptr;
138 Qt3DRender::QParameter *mBloomFactorParameter = nullptr;
139
140 Qt3DRender::QParameter *mExposureParameter = nullptr;
141 Qt3DRender::QParameter *mToneMappingParameter = nullptr;
142};
143
144#endif // QGSPOSTPROCESSINGENTITY_H
static constexpr int NUM_SHADOW_CASCADES
Number of shadow map cascades.
Definition qgs3d.h:104
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 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 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.
void updateColorGradingSettings(const QgsColorGradingSettings &settings)
Updates settings for color grading.
void updateShadowSettings(const QgsVector3D &lightDirection, float maximumShadowRenderingDistance)
Sets shadow rendering to use a directional light.
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.
A 3D vector (similar to QVector3D) with the difference that it uses double precision instead of singl...
Definition qgsvector3d.h:33