Skip to content

Commit

Permalink
ENH: Add API to access SSAO rendering pass in 3D views
Browse files Browse the repository at this point in the history
Direct access to the rendering pass allows experimentation and troubleshooting.
  • Loading branch information
lassoan authored and jcfr committed Mar 5, 2024
1 parent 5e831bc commit 6b81ca2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Libs/MRML/Widgets/qMRMLThreeDView.cxx
Expand Up @@ -653,3 +653,10 @@ void qMRMLThreeDView::setAmbientShadowsVolumeOpacityThreshold(double opacityThre

d->ShadowsRenderPass->SetVolumeOpacityThreshold(opacityThreshold);
}

//------------------------------------------------------------------------------
vtkSSAOPass* qMRMLThreeDView::ssaoPass()const
{
Q_D(const qMRMLThreeDView);
return d->ShadowsRenderPass;
}
5 changes: 5 additions & 0 deletions Libs/MRML/Widgets/qMRMLThreeDView.h
Expand Up @@ -35,6 +35,7 @@ class vtkMRMLScene;
class vtkMRMLThreeDViewInteractorStyle;
class vtkMRMLViewNode;
class vtkCollection;
class vtkSSAOPass;

/// \brief 3D view for view nodes.
/// For performance reasons, the view block refreshes when the scene is in
Expand Down Expand Up @@ -116,6 +117,10 @@ class QMRML_WIDGETS_EXPORT qMRMLThreeDView : public ctkVTKRenderView
double ambientShadowsSizeScale()const;
double ambientShadowsVolumeOpacityThreshold()const;

/// Advanced option to directly access SSAO pass used to render the ambient shadows.
/// Intended for experimentation and troubleshooting only.
Q_INVOKABLE vtkSSAOPass* ssaoPass()const;

public slots:

/// Set the MRML \a scene that should be listened for events
Expand Down

0 comments on commit 6b81ca2

Please sign in to comment.