16 #ifndef QGSSHADOWRENDERINGFRAMEGRAPH_H
17 #define QGSSHADOWRENDERINGFRAMEGRAPH_H
20 #include <Qt3DRender/QCamera>
21 #include <Qt3DRender/QRenderSurfaceSelector>
22 #include <Qt3DRender/QViewport>
23 #include <Qt3DRender/QCameraSelector>
24 #include <Qt3DRender/QLayerFilter>
25 #include <Qt3DRender/QLayer>
26 #include <Qt3DRender/QRenderTargetSelector>
27 #include <Qt3DRender/QRenderTarget>
28 #include <Qt3DRender/QTexture>
29 #include <Qt3DRender/QClearBuffers>
30 #include <Qt3DRender/QParameter>
31 #include <Qt3DRender/QFrustumCulling>
32 #include <Qt3DRender/QRenderStateSet>
33 #include <Qt3DRender/QDepthTest>
34 #include <Qt3DRender/QCullFace>
35 #include <Qt3DRender/QPolygonOffset>
36 #include <Qt3DRender/QRenderCapture>
37 #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
38 #include <Qt3DRender/QDebugOverlay>
68 Qt3DRender::QFrameGraphNode *
frameGraphRoot() {
return mRenderSurfaceSelector; }
93 Qt3DRender::QCamera *
mainCamera() {
return mMainCamera; }
131 QgsPreviewQuad *
addTexturePreviewOverlay( Qt3DRender::QTexture2D *texture,
const QPointF ¢erNDC,
const QSizeF &size, QVector<Qt3DRender::QParameter *> additionalShaderParameters = QVector<Qt3DRender::QParameter *>() );
162 Qt3DRender::QRenderSurfaceSelector *mRenderSurfaceSelector =
nullptr;
163 Qt3DRender::QViewport *mMainViewPort =
nullptr;
164 bool mFrustumCullingEnabled =
true;
166 Qt3DRender::QCamera *mMainCamera =
nullptr;
167 Qt3DRender::QCamera *mLightCamera =
nullptr;
170 Qt3DRender::QCameraSelector *mMainCameraSelector =
nullptr;
171 Qt3DRender::QLayerFilter *mForwardRenderLayerFilter =
nullptr;
172 Qt3DRender::QRenderTargetSelector *mForwardRenderTargetSelector =
nullptr;
173 Qt3DRender::QClearBuffers *mForwardClearBuffers =
nullptr;
174 Qt3DRender::QFrustumCulling *mFrustumCulling =
nullptr;
176 Qt3DRender::QTexture2D *mForwardColorTexture =
nullptr;
177 Qt3DRender::QTexture2D *mForwardDepthTexture =
nullptr;
179 #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
180 Qt3DRender::QDebugOverlay *mDebugOverlay =
nullptr;
184 Qt3DRender::QCameraSelector *mLightCameraSelectorShadowPass =
nullptr;
185 Qt3DRender::QLayerFilter *mShadowSceneEntitiesFilter =
nullptr;
186 Qt3DRender::QRenderTargetSelector *mShadowRenderTargetSelector =
nullptr;
187 Qt3DRender::QClearBuffers *mShadowClearBuffers =
nullptr;
188 Qt3DRender::QRenderStateSet *mShadowRenderStateSet =
nullptr;
190 Qt3DRender::QTexture2D *mShadowMapTexture =
nullptr;
196 Qt3DRender::QCameraSelector *mDepthRenderCameraSelector =
nullptr;
197 Qt3DRender::QRenderStateSet *mDepthRenderStateSet =
nullptr;;
198 Qt3DRender::QLayerFilter *mDepthRenderLayerFilter =
nullptr;
199 Qt3DRender::QRenderTargetSelector *mDepthRenderCaptureTargetSelector =
nullptr;
200 Qt3DRender::QRenderCapture *mDepthRenderCapture =
nullptr;
202 Qt3DRender::QTexture2D *mDepthRenderCaptureDepthTexture =
nullptr;
203 Qt3DRender::QTexture2D *mDepthRenderCaptureColorTexture =
nullptr;
206 Qt3DRender::QCameraSelector *mPostProcessingCameraSelector =
nullptr;
207 Qt3DRender::QLayerFilter *mPostprocessPassLayerFilter =
nullptr;
208 Qt3DRender::QClearBuffers *mPostprocessClearBuffers =
nullptr;
209 Qt3DRender::QRenderTargetSelector *mRenderCaptureTargetSelector =
nullptr;
210 Qt3DRender::QRenderCapture *mRenderCapture =
nullptr;
212 Qt3DRender::QTexture2D *mRenderCaptureColorTexture =
nullptr;
213 Qt3DRender::QTexture2D *mRenderCaptureDepthTexture =
nullptr;
216 Qt3DRender::QLayerFilter *mPreviewLayerFilter =
nullptr;
217 Qt3DRender::QRenderStateSet *mPreviewRenderStateSet =
nullptr;
218 Qt3DRender::QDepthTest *mPreviewDepthTest =
nullptr;
219 Qt3DRender::QCullFace *mPreviewCullFace =
nullptr;
221 bool mShadowRenderingEnabled =
false;
222 float mShadowBias = 0.00001f;
223 int mShadowMapResolution = 2048;
225 QSize mSize = QSize( 1024, 768 );
227 bool mEyeDomeLightingEnabled =
false;
228 double mEyeDomeLightingStrength = 1000.0;
229 int mEyeDomeLightingDistance = 1;
234 QEntity *mDepthRenderQuad =
nullptr;
236 QVector3D mLightDirection = QVector3D( 0.0, -1.0f, 0.0f );
238 Qt3DCore::QEntity *mRootEntity =
nullptr;
240 Qt3DRender::QLayer *mPostprocessPassLayer =
nullptr;
241 Qt3DRender::QLayer *mPreviewLayer =
nullptr;
242 Qt3DRender::QLayer *mForwardRenderLayer =
nullptr;
243 Qt3DRender::QLayer *mCastShadowsLayer =
nullptr;
244 Qt3DRender::QLayer *mDepthRenderPassLayer =
nullptr;
245 Qt3DRender::QLayer *mTransparentObjectsPassLayer =
nullptr;
249 QVector<QgsPreviewQuad *> mPreviewQuads;
251 Qt3DRender::QFrameGraphNode *constructShadowRenderPass();
252 Qt3DRender::QFrameGraphNode *constructForwardRenderPass();
253 Qt3DRender::QFrameGraphNode *constructTexturesPreviewPass();
254 Qt3DRender::QFrameGraphNode *constructPostprocessingPass();
255 Qt3DRender::QFrameGraphNode *constructDepthRenderPass();
257 Qt3DCore::QEntity *constructDepthRenderQuad();
259 bool mRenderCaptureEnabled =
true;
264 #endif // QGSSHADOWRENDERINGFRAMEGRAPH_H