QGIS API Documentation 3.43.0-Master (c67cf405802)
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
20
21class QColor;
22class QRect;
23class QSurface;
24
25namespace Qt3DCore
26{
27 class QEntity;
28}
29
30namespace Qt3DRender
31{
32 class QRenderSettings;
33 class QCamera;
34 class QFrameGraphNode;
35 class QLayer;
36 class QViewport;
37 class QSubtreeEnabler;
38 class QTexture2D;
39 class QCameraSelector;
40 class QLayerFilter;
41 class QRenderTargetSelector;
42 class QClearBuffers;
43 class QRenderStateSet;
44 class QRenderTarget;
45 class QRenderTargetOutput;
46} // namespace Qt3DRender
47
48namespace Qt3DExtras
49{
50 class Qt3DWindow;
51}
52
55class QgsLightSource;
56
57#define SIP_NO_FILE
58
68{
69 public:
71 QgsShadowRenderView( const QString &viewName );
72
74 virtual void setEnabled( bool enable ) override;
75
77 Qt3DRender::QCamera *lightCamera() { return mLightCamera; }
78
80 Qt3DRender::QTexture2D *mapTexture() const;
81
83 Qt3DRender::QLayer *entityCastingShadowsLayer() const;
84
86 void setMapSize( int width, int height );
87
88 private:
89 static constexpr int mDefaultMapResolution = 2048;
90
91 // Shadow rendering pass branch nodes:
92 Qt3DRender::QLayer *mEntityCastingShadowsLayer = nullptr;
93 Qt3DRender::QLayerFilter *mLayerFilter = nullptr;
94 Qt3DRender::QCamera *mLightCamera = nullptr;
95 Qt3DRender::QTexture2D *mMapTexture = nullptr;
96
97 Qt3DRender::QRenderTarget *buildTextures();
98 void buildRenderPass();
99};
100
101#endif // QGSSHADOWRENDERVIEW_H
Base class for 3D render view.
Definition of a directional light in a 3D map scene.
Base class for light sources in 3d scenes.
Container class that holds different objects related to shadow rendering.
Qt3DRender::QLayer * entityCastingShadowsLayer() const
Returns the layer to be used by entities to be included in this renderview.
void setMapSize(int width, int height)
Update shadow depth texture size.
virtual void setEnabled(bool enable) override
Enable or disable via enable the renderview sub tree.
Qt3DRender::QCamera * lightCamera()
Returns the light camera.
Qt3DRender::QTexture2D * mapTexture() const
Returns shadow depth texture.
Contains configuration for rendering shadows.