QGIS API Documentation 4.5.0-Master (0fddd5b8877)
Loading...
Searching...
No Matches
qgsshadowrenderview.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsshadowrenderview.h
3 --------------------------------------
4 Date : June 2024
5 Copyright : (C) 2024 by Benoit De Mezzo and (C) 2020 by Belgacem Nedjima
6 Email : benoit dot de dot mezzo at oslandia dot com
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 QGSSHADOWRENDERVIEW_H
17#define QGSSHADOWRENDERVIEW_H
18
19#include "qgs3d.h"
21
22#define SIP_NO_FILE
23
24class QColor;
25class QRect;
26class QSurface;
27
28namespace Qt3DCore
29{
30 class QEntity;
31}
32
33namespace Qt3DRender
34{
35 class QRenderSettings;
36 class QCamera;
37 class QFrameGraphNode;
38 class QLayer;
39 class QViewport;
40 class QSubtreeEnabler;
41 class QTexture2D;
42 class QCameraSelector;
43 class QLayerFilter;
44 class QRenderTargetSelector;
45 class QClearBuffers;
46 class QRenderStateSet;
47 class QRenderTarget;
48 class QRenderTargetOutput;
49 class QTexture2DArray;
50} // namespace Qt3DRender
51
52namespace Qt3DExtras
53{
54 class Qt3DWindow;
55}
56
59class QgsLightSource;
60
61
71{
72 public:
74 QgsShadowRenderView( const QString &viewName, Qt3DCore::QEntity *rootEntity );
75
77 void setEnabled( bool enable ) override;
78
80 Qt3DRender::QCamera *lightCamera( int index );
81
83 Qt3DRender::QTexture2DArray *mapTextureArray() const;
84
86 Qt3DRender::QLayer *entityCastingShadowsLayer() const;
87
89 void setMapSize( int width, int height );
90
91 private:
92 static constexpr int mDefaultMapResolution = 2048;
93 Qt3DCore::QEntity *mRootEntity = nullptr;
94
95 // Shadow rendering pass branch nodes:
96 Qt3DRender::QLayer *mEntityCastingShadowsLayer = nullptr;
97 Qt3DRender::QLayerFilter *mLayerFilter = nullptr;
98 Qt3DRender::QCamera *mLightCameras[Qgs3D::NUM_SHADOW_CASCADES] = { nullptr };
99 Qt3DRender::QTexture2DArray *mMapTextureArray = nullptr;
100
101 void buildRenderPass();
102};
103
104#endif // QGSSHADOWRENDERVIEW_H
static constexpr int NUM_SHADOW_CASCADES
Number of shadow map cascades.
Definition qgs3d.h:113
virtual void setEnabled(bool enable)
Enable or disable via enable the render view sub tree.
QgsAbstractRenderView(const QString &viewName)
Constructor for QgsAbstractRenderView with the specified parent object.
Definition of a directional light in a 3D map scene.
Base class for light sources in 3d scenes.
Qt3DRender::QLayer * entityCastingShadowsLayer() const
Returns the layer to be used by entities to be included in this renderview.
Qt3DRender::QCamera * lightCamera(int index)
Returns the light camera with the specified index.
void setMapSize(int width, int height)
Update shadow depth texture size.
Qt3DRender::QTexture2DArray * mapTextureArray() const
Returns the shadow depth texture array.
QgsShadowRenderView(const QString &viewName, Qt3DCore::QEntity *rootEntity)
Default constructor.
Contains configuration for rendering shadows.