Skip to content

Commit

Permalink
qgsframegraph: rename QRenderTarget in the ambient occlusion pass
Browse files Browse the repository at this point in the history
The output is the color buffer, not a depth one.
  • Loading branch information
ptitjano authored and lbartoletti committed Jun 24, 2024
1 parent b362ee6 commit 5af079e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/3d/qgsframegraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,13 @@ Qt3DRender::QFrameGraphNode *QgsFrameGraph::constructAmbientOcclusionRenderPass(
mAmbientOcclusionRenderLayerFilter = new Qt3DRender::QLayerFilter( mAmbientOcclusionRenderStateSet );

mAmbientOcclusionRenderCaptureTargetSelector = new Qt3DRender::QRenderTargetSelector( mAmbientOcclusionRenderLayerFilter );
Qt3DRender::QRenderTarget *depthRenderTarget = new Qt3DRender::QRenderTarget( mAmbientOcclusionRenderCaptureTargetSelector );
Qt3DRender::QRenderTarget *colorRenderTarget = new Qt3DRender::QRenderTarget( mAmbientOcclusionRenderCaptureTargetSelector );

// The lifetime of the objects created here is managed
// automatically, as they become children of this object.

// Create a render target output for rendering color.
Qt3DRender::QRenderTargetOutput *colorOutput = new Qt3DRender::QRenderTargetOutput( depthRenderTarget );
Qt3DRender::QRenderTargetOutput *colorOutput = new Qt3DRender::QRenderTargetOutput( colorRenderTarget );
colorOutput->setAttachmentPoint( Qt3DRender::QRenderTargetOutput::Color0 );

// Create a texture to render into.
Expand All @@ -370,9 +370,9 @@ Qt3DRender::QFrameGraphNode *QgsFrameGraph::constructAmbientOcclusionRenderPass(

// Hook the texture up to our output, and the output up to this object.
colorOutput->setTexture( mAmbientOcclusionRenderTexture );
depthRenderTarget->addOutput( colorOutput );
colorRenderTarget->addOutput( colorOutput );

mAmbientOcclusionRenderCaptureTargetSelector->setTarget( depthRenderTarget );
mAmbientOcclusionRenderCaptureTargetSelector->setTarget( colorRenderTarget );

mAmbientOcclusionRenderEntity = new QgsAmbientOcclusionRenderEntity( mForwardDepthTexture, mMainCamera, mRootEntity );
mAmbientOcclusionRenderLayerFilter->addLayer( mAmbientOcclusionRenderEntity->layer() );
Expand Down

0 comments on commit 5af079e

Please sign in to comment.