33#include <Qt3DCore/QAttribute>
34#include <Qt3DCore/QBuffer>
35#include <Qt3DCore/QGeometry>
36#include <Qt3DRender/QAbstractTexture>
37#include <Qt3DRender/QBlendEquation>
38#include <Qt3DRender/QBlendEquationArguments>
39#include <Qt3DRender/QBlitFramebuffer>
40#include <Qt3DRender/QColorMask>
41#include <Qt3DRender/QGeometryRenderer>
42#include <Qt3DRender/QGraphicsApiFilter>
43#include <Qt3DRender/QNoDepthMask>
44#include <Qt3DRender/QNoDraw>
45#include <Qt3DRender/QSortPolicy>
46#include <Qt3DRender/QTechnique>
49#include "tracy/Tracy.hpp"
52#include "moc_qgsframegraph.cpp"
63void QgsFrameGraph::constructForwardRenderPass()
68void QgsFrameGraph::constructHighlightsPass()
73void QgsFrameGraph::constructShadowRenderPass()
78void QgsFrameGraph::constructOverlayTexturePass( Qt3DRender::QFrameGraphNode *topNode )
83Qt3DRender::QFrameGraphNode *QgsFrameGraph::constructSubPostPassForProcessing()
85 Qt3DRender::QLayerFilter *layerFilter =
new Qt3DRender::QLayerFilter();
88 new Qt3DRender::QClearBuffers( layerFilter );
90 Qt3DRender::QLayer *postProcessingLayer =
new Qt3DRender::QLayer();
91 mPostprocessingEntity =
new QgsPostprocessingEntity(
this, postProcessingLayer, mRootEntity );
92 layerFilter->addLayer( postProcessingLayer );
93 mPostprocessingEntity->setObjectName(
"PostProcessingPassEntity" );
98Qt3DRender::QFrameGraphNode *QgsFrameGraph::constructSubPostPassForRenderCapture()
100 Qt3DRender::QFrameGraphNode *top =
new Qt3DRender::QNoDraw;
101 top->setObjectName(
"Sub pass RenderCapture" );
103 mRenderCapture =
new Qt3DRender::QRenderCapture( top );
108void QgsFrameGraph::updateThumbnailTextureSize()
112 const int width = ( mSize.width() / 10 ) & ~3;
113 const int height = ( mSize.height() / 10 ) & ~3;
114 mThumbnailTexture->setSize( width, height );
117void QgsFrameGraph::constructThumbnailCapturePass()
125 mThumbnailTexture =
new Qt3DRender::QTexture2D(
this );
126 mThumbnailTexture->setFormat( Qt3DRender::QAbstractTexture::RGBA8_UNorm );
127 updateThumbnailTextureSize();
129 Qt3DRender::QRenderTargetOutput *renderTargetOutput =
new Qt3DRender::QRenderTargetOutput(
this );
130 renderTargetOutput->setTexture( mThumbnailTexture );
132 Qt3DRender::QRenderTarget *renderTarget =
new Qt3DRender::QRenderTarget(
this );
133 renderTarget->addOutput( renderTargetOutput );
136 Qt3DRender::QBlitFramebuffer *blit =
new Qt3DRender::QBlitFramebuffer( mMainViewPort );
137 blit->setObjectName(
"Framebuffer copy for thumbnail" );
139 blit->setDestination( renderTarget );
140 blit->setSourceRect( QRectF( 0, 0, 1, 1 ) );
141 blit->setDestinationRect( QRectF( 0, 0, 1, 1 ) );
142 blit->setInterpolationMethod( Qt3DRender::QBlitFramebuffer::Linear );
144 Qt3DRender::QRenderTargetSelector *targetSelector =
new Qt3DRender::QRenderTargetSelector( mMainViewPort );
145 targetSelector->setObjectName(
"Thumbnail capture target selector" );
146 targetSelector->setTarget( renderTarget );
148 mThumbnailCapture =
new Qt3DRender::QRenderCapture( targetSelector );
149 mThumbnailCapture->setObjectName(
"Thumbnail capture" );
154 Qt3DRender::QRenderCaptureReply *reply1 = mThumbnailCapture->requestCapture();
155 Qt3DRender::QRenderCaptureReply *reply2 = mThumbnailCapture->requestCapture();
156 for ( Qt3DRender::QRenderCaptureReply *reply : { reply1, reply2 } )
157 connect( reply, &Qt3DRender::QRenderCaptureReply::completed,
this, [
this, reply]() { onThumbnailCaptureCompleted( reply ); } );
160void QgsFrameGraph::onThumbnailCaptureCompleted( Qt3DRender::QRenderCaptureReply *reply )
162 reply->deleteLater();
166 QImage rgbaImage = reply->image().convertToFormat( QImage::Format_RGBA8888 );
170 rgbaImage.constBits(),
171 static_cast<uint16_t
>( rgbaImage.width() ),
172 static_cast<uint16_t
>( rgbaImage.height() ),
179 Qt3DRender::QRenderCaptureReply *nextReply = mThumbnailCapture->requestCapture();
180 connect( nextReply, &Qt3DRender::QRenderCaptureReply::completed,
this, [
this, nextReply]() { onThumbnailCaptureCompleted( nextReply ); } );
183Qt3DRender::QFrameGraphNode *QgsFrameGraph::constructPostprocessingPass()
185 mRenderCaptureTargetSelector =
new Qt3DRender::QRenderTargetSelector;
186 mRenderCaptureTargetSelector->setObjectName(
"Postprocessing render pass" );
187 mRenderCaptureTargetSelector->setEnabled( mRenderCaptureEnabled );
189 Qt3DRender::QRenderTarget *renderTarget =
new Qt3DRender::QRenderTarget( mRenderCaptureTargetSelector );
195 Qt3DRender::QRenderTargetOutput *colorOutput =
new Qt3DRender::QRenderTargetOutput( renderTarget );
196 colorOutput->setAttachmentPoint( Qt3DRender::QRenderTargetOutput::Color0 );
199 mRenderCaptureColorTexture =
new Qt3DRender::QTexture2D( colorOutput );
200 mRenderCaptureColorTexture->setSize( mSize.width(), mSize.height() );
201 mRenderCaptureColorTexture->setFormat( Qt3DRender::QAbstractTexture::RGB8_UNorm );
202 mRenderCaptureColorTexture->setMinificationFilter( Qt3DRender::QAbstractTexture::Linear );
203 mRenderCaptureColorTexture->setMagnificationFilter( Qt3DRender::QAbstractTexture::Linear );
204 mRenderCaptureColorTexture->setObjectName(
"PostProcessingPass::ColorTarget" );
207 colorOutput->setTexture( mRenderCaptureColorTexture );
208 renderTarget->addOutput( colorOutput );
210 Qt3DRender::QRenderTargetOutput *depthOutput =
new Qt3DRender::QRenderTargetOutput( renderTarget );
212 depthOutput->setAttachmentPoint( Qt3DRender::QRenderTargetOutput::Depth );
213 mRenderCaptureDepthTexture =
new Qt3DRender::QTexture2D( depthOutput );
214 mRenderCaptureDepthTexture->setSize( mSize.width(), mSize.height() );
215 mRenderCaptureDepthTexture->setFormat( Qt3DRender::QAbstractTexture::DepthFormat );
216 mRenderCaptureDepthTexture->setMinificationFilter( Qt3DRender::QAbstractTexture::Linear );
217 mRenderCaptureDepthTexture->setMagnificationFilter( Qt3DRender::QAbstractTexture::Linear );
218 mRenderCaptureDepthTexture->setComparisonFunction( Qt3DRender::QAbstractTexture::CompareLessEqual );
219 mRenderCaptureDepthTexture->setComparisonMode( Qt3DRender::QAbstractTexture::CompareRefToTexture );
220 mRenderCaptureDepthTexture->setObjectName(
"PostProcessingPass::DepthTarget" );
222 depthOutput->setTexture( mRenderCaptureDepthTexture );
223 renderTarget->addOutput( depthOutput );
225 mRenderCaptureTargetSelector->setTarget( renderTarget );
228 constructSubPostPassForProcessing()->setParent( mRenderCaptureTargetSelector );
229 constructOverlayTexturePass( mRenderCaptureTargetSelector );
230 constructSubPostPassForRenderCapture()->setParent( mRenderCaptureTargetSelector );
232 return mRenderCaptureTargetSelector;
235void QgsFrameGraph::constructAmbientOcclusionRenderPass()
239 QgsAmbientOcclusionRenderView *aorv =
new QgsAmbientOcclusionRenderView(
AMBIENT_OCCLUSION_RENDERVIEW, mMainCamera, mSize, forwardDepthTexture, mRootEntity );
243void QgsFrameGraph::constructBloomRenderPass()
247 QgsBloomRenderView *rv =
new QgsBloomRenderView(
BLOOM_RENDERVIEW, forwardColorTexture, mSize, mRootEntity );
251Qt3DRender::QFrameGraphNode *QgsFrameGraph::constructRubberBandsPass()
253 mRubberBandsCameraSelector =
new Qt3DRender::QCameraSelector;
254 mRubberBandsCameraSelector->setObjectName(
"RubberBands Pass CameraSelector" );
255 mRubberBandsCameraSelector->setCamera( mMainCamera );
257 mRubberBandsLayerFilter =
new Qt3DRender::QLayerFilter( mRubberBandsCameraSelector );
258 mRubberBandsLayerFilter->addLayer( mRubberBandsLayer );
260 Qt3DRender::QBlendEquationArguments *blendState =
new Qt3DRender::QBlendEquationArguments;
261 blendState->setSourceRgb( Qt3DRender::QBlendEquationArguments::SourceAlpha );
262 blendState->setDestinationRgb( Qt3DRender::QBlendEquationArguments::OneMinusSourceAlpha );
264 Qt3DRender::QBlendEquation *blendEquation =
new Qt3DRender::QBlendEquation;
265 blendEquation->setBlendFunction( Qt3DRender::QBlendEquation::Add );
267 mRubberBandsStateSet =
new Qt3DRender::QRenderStateSet( mRubberBandsLayerFilter );
268 Qt3DRender::QDepthTest *depthTest =
new Qt3DRender::QDepthTest;
269 depthTest->setDepthFunction( Qt3DRender::QDepthTest::Always );
270 mRubberBandsStateSet->addRenderState( depthTest );
271 mRubberBandsStateSet->addRenderState( blendState );
272 mRubberBandsStateSet->addRenderState( blendEquation );
277 mRubberBandsRenderTargetSelector =
new Qt3DRender::QRenderTargetSelector( mRubberBandsStateSet );
278 mRubberBandsRenderTargetSelector->setTarget(
forwardRenderView().renderTargetSelector()->target() );
280 return mRubberBandsCameraSelector;
283void QgsFrameGraph::constructDepthRenderPass()
287 QgsDepthRenderView *rv =
new QgsDepthRenderView(
DEPTH_RENDERVIEW, mSize, forwardDepthTexture, mRootEntity );
298 for ( Qt3DRender::QParameter *param : parameters )
300 mGlobalParamsStorage->addParameter( param );
346 mRubberBandsLayer =
new Qt3DRender::QLayer;
347 mRubberBandsLayer->setObjectName(
"mRubberBandsLayer" );
348 mRubberBandsLayer->setRecursive(
true );
350 mRenderSurfaceSelector =
new Qt3DRender::QRenderSurfaceSelector;
352 QObject *surfaceObj =
dynamic_cast<QObject *
>( surface );
353 Q_ASSERT( surfaceObj );
355 mRenderSurfaceSelector->setSurface( surfaceObj );
356 mRenderSurfaceSelector->setExternalRenderTargetSize( mSize );
358 mMainViewPort =
new Qt3DRender::QViewport( mRenderSurfaceSelector );
359 mMainViewPort->setNormalizedRect( QRectF( 0.0f, 0.0f, 1.0f, 1.0f ) );
361 mGlobalParamsStorage =
new Qt3DRender::QRenderPassFilter( mMainViewPort );
362 mGlobalParamsStorage->setObjectName(
"GlobalParametersStore" );
366 constructShadowRenderPass();
369 constructForwardRenderPass();
372 constructHighlightsPass();
375 Qt3DRender::QFrameGraphNode *rubberBandsPass = constructRubberBandsPass();
376 rubberBandsPass->setObjectName(
"rubberBandsPass" );
377 rubberBandsPass->setParent( mGlobalParamsStorage );
379 mMsaaBlitNode =
new Qt3DRender::QBlitFramebuffer( mGlobalParamsStorage );
380 mMsaaBlitNode->setObjectName(
"MsaaBlitFramebuffer" );
381 mMsaaBlitNode->setEnabled(
false );
383 mMsaaDepthBlitNode =
new Qt3DRender::QBlitFramebuffer( mGlobalParamsStorage );
384 mMsaaDepthBlitNode->setObjectName(
"MsaaDepthBlitFramebuffer" );
385 mMsaaDepthBlitNode->setEnabled(
false );
388 constructDepthRenderPass();
391 constructAmbientOcclusionRenderPass();
393 constructBloomRenderPass();
396 Qt3DRender::QFrameGraphNode *postprocessingPass = constructPostprocessingPass();
397 postprocessingPass->setParent( mGlobalParamsStorage );
398 postprocessingPass->setObjectName(
"PostProcessingPass" );
401 constructThumbnailCapturePass();
404 mRubberBandsRootEntity =
new Qt3DCore::QEntity( mRootEntity );
405 mRubberBandsRootEntity->setObjectName(
"mRubberBandsRootEntity" );
406 mRubberBandsRootEntity->addComponent( mRubberBandsLayer );
411 if ( mRenderViewMap.find( name ) != mRenderViewMap.end() )
413 mRenderViewMap[name]->topGraphNode()->setParent( ( QNode * )
nullptr );
414 mRenderViewMap.erase( name );
421 if ( mRenderViewMap.find( name ) == mRenderViewMap.end() )
423 mRenderViewMap[name] = std::move(
renderView );
424 mRenderViewMap[name]->topGraphNode()->setParent( topNode ? topNode : mGlobalParamsStorage );
425 mRenderViewMap[name]->updateWindowResize( mSize.width(), mSize.height() );
436 if ( mRenderViewMap[name] )
438 mRenderViewMap[name]->setEnabled( enable );
444 if ( mRenderViewMap.find( name ) != mRenderViewMap.end() )
446 return mRenderViewMap[name].get();
453 return mRenderViewMap[name] !=
nullptr && mRenderViewMap[name]->
isEnabled();
465 mPostprocessingEntity->setAmbientOcclusionEnabled( settings.
isEnabled() );
480 mPostprocessingEntity->setBloomEnabled( settings.
isEnabled() );
481 mPostprocessingEntity->setBloomFactor(
static_cast< float >( settings.
intensity() ) );
487 mPostprocessingEntity->updateColorGradingSettings( settings );
493 const QList<QgsLightSource *> lightSources = mapSettings.
lightSources();
496 const QString lightSourceId = shadowSettings.
lightSource();
498 int globalLightIndex = 0;
499 for (
int i = 0; !light && i < lightSources.size(); i++ )
501 if ( lightSources[i]->
id() == lightSourceId )
503 light = lightSources[i];
504 globalLightIndex = i;
513 lightDirection = directionalLight->direction();
517 lightDirection = sunLight->direction( mapSettings );
523 mPostprocessingEntity->setShadowRenderingEnabled(
true );
524 mPostprocessingEntity->setShadowMapResolution( size );
525 mPostprocessingEntity->setShadowLightIndex( globalLightIndex );
526 mPostprocessingEntity->setShadowBias(
static_cast<float>( shadowSettings.
shadowBias() ) );
528 mPostprocessingEntity->setShowCascadingShadowSplits( shadowSettings.
showCascadeSplits() );
534 mPostprocessingEntity->setShadowRenderingEnabled(
false );
541 if ( !debugRenderView )
552 if ( mDepthTextureDebugging )
559 delete mDepthTextureDebugging;
560 mDepthTextureDebugging =
nullptr;
567 QObject *top = mRenderSurfaceSelector;
568 while ( top->parent() &&
dynamic_cast<Qt3DRender::QFrameGraphNode *
>( top->parent() ) )
572 context.
lowestId = mMainCamera->id().id();
575 return strList.join(
"\n" ) + QString(
"\n" );
581 return strList.join(
"\n" ) + QString(
"\n" );
597 for (
auto it = mRenderViewMap.begin(); it != mRenderViewMap.end(); ++it )
603 mRenderCaptureColorTexture->setSize( mSize.width(), mSize.height() );
604 mRenderCaptureDepthTexture->setSize( mSize.width(), mSize.height() );
605 mRenderSurfaceSelector->setExternalRenderTargetSize( mSize );
607 mMsaaBlitNode->setSourceRect( QRect( 0, 0, mSize.width(), mSize.height() ) );
608 mMsaaBlitNode->setDestinationRect( QRect( 0, 0, mSize.width(), mSize.height() ) );
609 mMsaaDepthBlitNode->setSourceRect( QRect( 0, 0, mSize.width(), mSize.height() ) );
610 mMsaaDepthBlitNode->setDestinationRect( QRect( 0, 0, mSize.width(), mSize.height() ) );
612 if ( mThumbnailTexture )
613 updateThumbnailTextureSize();
618 return mRenderCapture;
623 if ( enabled == mRenderCaptureEnabled )
625 mRenderCaptureEnabled = enabled;
626 mRenderCaptureTargetSelector->setEnabled( mRenderCaptureEnabled );
636 mMsaaEnabled = enabled;
638 if ( !enabled && mMsaaBlitConfigured )
640 mMsaaBlitNode->setSource(
nullptr );
641 mMsaaBlitNode->setDestination(
nullptr );
642 mMsaaDepthBlitNode->setSource(
nullptr );
643 mMsaaDepthBlitNode->setDestination(
nullptr );
644 mMsaaBlitConfigured =
false;
649 if ( enabled && !mMsaaBlitConfigured )
651 mMsaaBlitConfigured =
true;
654 mMsaaBlitNode->setSourceRect( QRect( 0, 0, mSize.width(), mSize.height() ) );
655 mMsaaBlitNode->setDestinationRect( QRect( 0, 0, mSize.width(), mSize.height() ) );
656 mMsaaBlitNode->setSourceAttachmentPoint( Qt3DRender::QRenderTargetOutput::Color0 );
657 mMsaaBlitNode->setDestinationAttachmentPoint( Qt3DRender::QRenderTargetOutput::Color0 );
658 mMsaaBlitNode->setInterpolationMethod( Qt3DRender::QBlitFramebuffer::Nearest );
662 mMsaaDepthBlitNode->setSourceRect( QRect( 0, 0, mSize.width(), mSize.height() ) );
663 mMsaaDepthBlitNode->setDestinationRect( QRect( 0, 0, mSize.width(), mSize.height() ) );
664 mMsaaDepthBlitNode->setSourceAttachmentPoint( Qt3DRender::QRenderTargetOutput::DepthStencil );
665 mMsaaDepthBlitNode->setDestinationAttachmentPoint( Qt3DRender::QRenderTargetOutput::DepthStencil );
666 mMsaaDepthBlitNode->setInterpolationMethod( Qt3DRender::QBlitFramebuffer::Nearest );
671 mRubberBandsRenderTargetSelector->setTarget( target );
672 mMsaaBlitNode->setEnabled( enabled );
673 mMsaaDepthBlitNode->setEnabled( enabled );
Qt::Corner debugDepthMapCorner() const
Returns the corner where the shadow map preview is displayed.
bool debugDepthMapEnabled() const
Returns whether the shadow map debugging is enabled.
double eyeDomeLightingStrength() const
Returns the eye dome lighting strength value.
QgsShadowSettings shadowSettings() const
Returns the current configuration of shadows.
QList< QgsLightSource * > lightSources() const
Returns list of directional light sources defined in the scene.
double debugDepthMapSize() const
Returns the size of the shadow map preview.
bool is2DMapOverlayEnabled() const
Returns whether 2D map overlay is enabled.
int eyeDomeLightingDistance() const
Returns the eye dome lighting distance value (contributes to the contrast of the image).
bool eyeDomeLightingEnabled() const
Returns whether eye dome lighting is used.
Base class for 3D render view.
virtual void setEnabled(bool enable)
Enable or disable via enable the render view sub tree.
virtual bool isEnabled() const
Returns true if render view is enabled.
virtual void updateWindowResize(int width, int height)
Called when 3D window is resized.
Container class that holds different objects related to ambient occlusion rendering.
void setRadius(float radius)
Delegates to QgsAmbientOcclusionRenderEntity::setRadius.
void setEnabled(bool enable) override
Enable or disable via enable the render view sub tree.
void setIntensity(float intensity)
Delegates to QgsAmbientOcclusionRenderEntity::setIntensity.
void setThreshold(float threshold)
Delegates to QgsAmbientOcclusionRenderEntity::setThreshold.
Contains the configuration of ambient occlusion rendering.
float radius() const
Returns the radius parameter of the ambient occlusion effect.
bool isEnabled() const
Returns whether ambient occlusion effect is enabled.
float intensity() const
Returns the shading factor of the ambient occlusion effect.
float threshold() const
Returns at what amount of occlusion the effect will kick in.
Container class that holds different objects related to bloom rendering.
Contains the configuration of the lighting "bloom" effect.
double intensity() const
Returns the intensity of the bloom effect.
double radius() const
Returns the filter radius for the bloom.
bool isEnabled() const
Returns whether the bloom effect is enabled.
Contains the configuration of the scene's color grading settings, such as exposure and tone mapping.
Container class that holds different objects related to depth rendering.
Qt3DRender::QRenderCapture * renderCapture()
Returns the render capture object used to take an image of the depth buffer of the scene.
Definition of a directional light in a 3D map scene.
Container class that holds different objects related to forward rendering.
void setClearColor(const QColor &clearColor)
Sets the clear color of the scene (background color).
Qt3DRender::QTexture2D * colorTexture() const
Returns forward color texture.
void setDebugOverlayEnabled(bool enabled)
Sets whether debug overlay is enabled.
void setMsaaEnabled(bool enabled)
Sets whether multisample anti-aliasing (MSAA) is enabled.
void setFrustumCullingEnabled(bool enabled)
Sets whether frustum culling is enabled.
Qt3DRender::QTexture2D * depthTexture() const
Returns forward depth texture.
void addClipPlanes(int nrClipPlanes)
Setups nrClipPlanes clip planes in the forward pass to enable OpenGL clipping.
void removeClipPlanes()
Disables OpenGL clipping.
Qt3DRender::QRenderTarget * msaaRenderTarget() const
Returns the multisampled render target used as blit source when MSAA is enabled.
Qt3DRender::QRenderTarget * regularRenderTarget() const
Returns the regular (single-sample) render target used as blit destination and postprocessing input.
static QStringList dumpFrameGraph(const Qt3DCore::QNode *node, FgDumpContext context)
Returns a tree view of the frame graph starting from node. The object ids will be given relatively to...
static QStringList dumpSceneGraph(const Qt3DCore::QNode *node, FgDumpContext context)
Returns a tree view of the scene graph starting from node. The object ids will be given relatively to...
void addGlobalParameters(const QList< Qt3DRender::QParameter * > ¶meters)
Adds additional global parameters to the graph.
void setMsaaEnabled(bool enabled)
Sets whether multisample anti-aliasing (MSAA) is enabled.
void updateAmbientOcclusionSettings(const QgsAmbientOcclusionSettings &settings)
Updates settings for ambient occlusion.
void updateEyeDomeSettings(const Qgs3DMapSettings &settings)
Updates settings for eye dome lighting.
void updateBloomSettings(const QgsBloomSettings &settings)
Updates settings for the bloom lighting effect.
bool isRenderViewEnabled(const QString &name)
Returns true if the render view named name is found and enabled.
void setRenderViewEnabled(const QString &name, bool enable)
Enables or disables the render view named name according to enable.
void addClipPlanes(int nrClipPlanes)
Setups nrClipPlanes clip planes in the forward pass to enable OpenGL clipping.
void updateColorGradingSettings(const QgsColorGradingSettings &settings)
Updates settings for color grading.
void unregisterRenderView(const QString &name)
Unregisters the render view named name, if any.
bool registerRenderView(std::unique_ptr< QgsAbstractRenderView > renderView, const QString &name, Qt3DRender::QFrameGraphNode *topNode=nullptr)
Registers a new the render view renderView with name name.
QString dumpFrameGraph() const
Dumps frame graph as string.
void setRenderCaptureEnabled(bool enabled)
Sets whether it will be possible to render to an image.
QgsAmbientOcclusionRenderView & ambientOcclusionRenderView()
Returns ambient occlusion renderview.
Qt3DRender::QRenderCapture * depthRenderCapture()
Returns the render capture object used to take an image of the depth buffer of the scene.
QgsAbstractRenderView * renderView(const QString &name)
Returns the render view named name, if any.
void removeClipPlanes()
Disables OpenGL clipping.
static const QString AMBIENT_OCCLUSION_RENDERVIEW
Ambient occlusion render view name.
QgsDepthRenderView & depthRenderView()
Returns depth renderview.
void setClearColor(const QColor &clearColor)
Sets the clear color of the scene (background color).
static const QString FORWARD_RENDERVIEW
void setFrustumCullingEnabled(bool enabled)
Sets whether frustum culling is enabled.
void updateShadowSettings(const Qgs3DMapSettings &mapSettings)
Updates shadow bias, light and texture size according to shadowSettings and lightSources.
static const QString SHADOW_RENDERVIEW
void setDebugOverlayEnabled(bool enabled)
Sets whether debug overlay is enabled.
static const QString HIGHLIGHTS_RENDERVIEW
QgsHighlightsRenderView & highlightsRenderView()
Returns the highlights renderview, used for rendering highlight overlays of identified features.
static const QString OVERLAY_RENDERVIEW
void updateDebugDepthMapSettings(const Qgs3DMapSettings &settings)
Updates settings for depth debug map.
static const QString AXIS3D_RENDERVIEW
QgsForwardRenderView & forwardRenderView()
Returns forward renderview.
QgsOverlayTextureRenderView & overlayTextureRenderView()
Returns overlay texture renderview.
QString dumpSceneGraph() const
Dumps scene graph as string.
QgsShadowRenderView & shadowRenderView()
Returns shadow renderview.
void setSize(QSize s)
Sets the size of the buffers used for rendering.
static const QString BLOOM_RENDERVIEW
QgsBloomRenderView & bloomRenderView()
Returns the bloom render view.
static const QString DEPTH_RENDERVIEW
Qt3DRender::QCamera * mainCamera()
Returns the main camera.
QgsFrameGraph(QSurface *surface, QSize s, Qt3DRender::QCamera *mainCamera, Qt3DCore::QEntity *root)
Constructor.
Qt3DRender::QRenderCapture * renderCapture()
Returns the render capture object used to take an image of the scene.
Container class that holds different objects related to highlighting identified features.
void setRenderTarget(Qt3DRender::QRenderTarget *target)
Switches the render target (called when toggling MSAA on/off).
Base class for light sources in 3d scenes.
An entity responsible for rendering an overlay texture in 3D view.
Simple render view to preview overlay textures in 3D view.
Qt3DRender::QLayer * overlayLayer() const
Returns layer in which entities must be added in the in order to be processed by this renderview.
Container class that holds different objects related to shadow rendering.
void setMapSize(int width, int height)
Update shadow depth texture size.
void setEnabled(bool enable) override
Enable or disable via enable the renderview sub tree.
Contains configuration for rendering shadows.
bool renderShadows() const
Returns whether shadow rendering is enabled.
static int qualityToMapResolution(Qgis::ShadowQuality quality)
Returns the shadow map resolution corresponding to the specified shadow quality.
double maximumShadowRenderingDistance() const
Returns the maximum shadow rendering distance accounted for when rendering shadows Objects further aw...
QString lightSource() const
Returns the ID of the light source casting shadows.
double shadowBias() const
Returns the shadow bias used to correct the numerical imprecision of shadows (for the depth test) Thi...
Qgis::ShadowQuality shadowQuality() const
Returns the quality of the shadow map texture used to generate the shadows.
bool showCascadeSplits() const
Returns true if the cascading shadow splits should be tinted in the view.
Definition of a sun light in a 3D map scene.
A 3D vector (similar to QVector3D) with the difference that it uses double precision instead of singl...