Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3D] Add support for polygon geometry & dashed outline in QgsRubberBand3D #60378

Merged
merged 11 commits into from
Feb 26, 2025
9 changes: 9 additions & 0 deletions src/3d/qgsframegraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,10 +478,19 @@ Qt3DRender::QFrameGraphNode *QgsFrameGraph::constructRubberBandsPass()
mRubberBandsLayerFilter = new Qt3DRender::QLayerFilter( mRubberBandsCameraSelector );
mRubberBandsLayerFilter->addLayer( mRubberBandsLayer );

Qt3DRender::QBlendEquationArguments *blendState = new Qt3DRender::QBlendEquationArguments;
blendState->setSourceRgb( Qt3DRender::QBlendEquationArguments::SourceAlpha );
blendState->setDestinationRgb( Qt3DRender::QBlendEquationArguments::OneMinusSourceAlpha );

Qt3DRender::QBlendEquation *blendEquation = new Qt3DRender::QBlendEquation;
blendEquation->setBlendFunction( Qt3DRender::QBlendEquation::Add );

mRubberBandsStateSet = new Qt3DRender::QRenderStateSet( mRubberBandsLayerFilter );
Qt3DRender::QDepthTest *depthTest = new Qt3DRender::QDepthTest;
depthTest->setDepthFunction( Qt3DRender::QDepthTest::Always );
mRubberBandsStateSet->addRenderState( depthTest );
mRubberBandsStateSet->addRenderState( blendState );
mRubberBandsStateSet->addRenderState( blendEquation );

// Here we attach our drawings to the render target also used by forward pass.
// This is kind of okay, but as a result, post-processing effects get applied
Expand Down
Loading
Loading