So I’m experiencing an issue utilizing the VTK SSAO pass whilst having translucent geometry within a scene. I’ve been utilizing the default renderer until recently but had to switch because as far as I know in order to use SSAOPass you need a delegate pass for the pass to feed on from and don’t know a method to get the current pass for a renderer.
I initially used the standard basic pass but even when setting depth peeling to true translucent geometry was being rendered behind opaque ones. Adding a specific depth pass with a translucent pass into a render sequence pass seems to produce the right render when SSAO is disabled:
However when SSAO is enabled I get something pretty peculiar, specific actors in the scene get colored in black, green, yellow & red depending on their screen-space quadrant and the Ambient Occlusion fails to be added.
The odd rendering is accompanied by the following warning message:
[ E1EB9740] vtkOpenGLState.cxx:655 WARN| Attempt to set draw buffers from a Framebuffer Object that is not bound.
Switching from vtkDualDepthPeelingPass() to vtkDepthPeelingPass() prevents the odd coloring however the SSAO pass still fails and presents the same warning.
If the translucent object is obscured in the scene the ambient occlusion works absolutely fine.
I’ve included an excerpt of the rendering code, hopefully it isn’t too different to what people are used to:
basicPasses = vtk.vtkRenderStepsPass() translucentpass = vtk.vtkTranslucentPass() volumepass = vtk.vtkVolumetricPass() depthpass = vtk.vtkDualDepthPeelingPass() depthpass.SetTranslucentPass(translucentpass) passes = vtk.vtkRenderPassCollection() passes.AddItem(basicPasses) passes.AddItem(translucentpass) passes.AddItem(volumepass) passes.AddItem(depthpass) # can be commented to disable DP seq = vtk.vtkSequencePass() seq.SetPasses(passes) ssao = vtk.vtkSSAOPass() ssao.SetRadius(30) ssao.SetDelegatePass(seq) ssao.SetBias(0.1) ssao.SetBlur(True) ssao.SetKernelSize(32) ren.SetPass(ssao) # can be set to seq to ignore SSAO ren.SetUseDepthPeeling(True) ren.SetOcclusionRatio(0.2) ren.SetMaximumNumberOfPeels(100)
I don’t know if there’s anything specific I’m missing here with respect to the order of multipass renders, this seems to work fine for either translucent actors or opaque actors with SSAO but doesnt when both are used.