The difference between my issue and this one is that I am updating both the gridRender’s and geoRenderer’s actors, sometimes removing all of the actors within a renderer entirely (empty renderer could mess up the clipping planes, not rendering anything, if the camera chooses it as the active renderer).
My assumption is that VTK is confused as to which renderer to use in order to set the shared camera’s clipping planes. I tried using vtkRenderer::ResetCameraClippingRange() on both of the renderer’s but cannot get the clipping planes to form properly
Is there someway I can tell VTK which renderer to look at when resetting the clipping planes/camera?
When calling ResetCameraClippingRange manually, you will have to compute the bounds for each renderer (using ComputeVisiblePropBounds method), combine the two bounds, and call ResetCameraClippingRange with the resulting bound as the argument.
I completely misunderstood how clipping planes work. To easily fix this you simply set the minRanges to a very small number, and the maxRanges to a very large one.
Yes indeed, clipping ranges should be updated each time the camera or the actors move.
One possibility is to override vtkRenderWindowInteractor::Render in order to add your code before the call to this->RenderWindow->Render()
Thank you so much for this advice, I didn’t have the slightest idea that you would have to do this every single time before calling RenderWindow->Render().
I managed to make my own implementation of vtkRenderWindow, overriding Render(), calculating the new clipping planes before calling the standard Render() at the end of my override.
The depth filter literally started to die when I implemented some tessellation, and if it wasn’t for this I would of had no idea what was going wrong, so perfect timing