I want to use stereo anaglyph with vtkOpenGLGPUVolumeRayCastMapper or vtkGPUVolumeRayCastMapper but stereo doesn’t work with GPU mappers.
Stereo works perfectly fine with vtkFixedPointVolumeRayCastMapper.
Attached screenshot shows left skull rendering with vtkOpenGLGPUVolumeRayCastMapper and right with vtkFixedPointVolumeRayCastMapper. If you use red and blue anaglyph glasses, you will clearly see the difference. There is no depth in the left skull which is rendered by GPU mapper, but depth is clearly seen in the right skull rendered by CPU mapper.
Any solution to this issue?
Did u manage to find good solution for this?
It is happening because the camera position passed
to the GPU Volume Rendering mapper is incorrect. It remains the same using the position when in non stereo mode.
The camera position for left and right needs to be set correctly otherwise the ray direction will be wrong.
I did a test by arbitrarily displacing the camera position along x axis for both eyes and anaglyph rendering was decently enough to match stereo polydata mapper rendering but far from a proper solution.
As I am relatively new to Vtk, I am trying to find a solution that will still work with the interactors like vtkInteractorStyleTrackballCamera.