[Paraview] Stereo Rendering guts (non-cave) in ParaView...
Nikhil Shetty
nikhil.shetty at kitware.com
Mon Aug 8 12:41:17 EDT 2011
Hi Jeff,
On Thu, Aug 4, 2011 at 7:25 PM, Jeff Mauldin <jamauld at sandia.gov> wrote:
> I am looking at some of the stereo rendering currently in ParaView
> (initially just by invoking the --stereo option at the command line).
>
> I have quite a bit of experience with stereo rendering both as a user and
> as a developer, and I can immediately see some problems with the stereo
> rendering I'm getting using the --stereo option. For example, objects at a
> far distance are not sufficiently far apart (objects at infinity would be
> projected on to the screen as far apart as the eyes, or almost so) and the
> left-eye/right-eye projections appear to be scaling linearly with the size
> of the rendering window (e.g. I make the rendering window twice as big and
> the left eye/right eye images become twice as far apart).
>
>
Awesome. There have been some fairly recent changes in stereo-rendering in
the recent past and any any feedback or suggestions for improvement will
be greatly appreciated. The person who will best be able to help you is on
vacation till next week but I'll try to help to the best of my knowledge.
> I'm wanting to do some significant digging here but the handling of the
> projection (both for a single eye and for stereo) is sufficiently complex
> that I don't have a good starting point. I see that glFrustum is only used
> once in a test; gluPerspective is only used once in a demo; glOrtho is used
> several places but doesn't appear to be the general projection handling
> method. I see glMatrixMode(GL_PROJECTION) used in the SetPixelData calls in
> vtkOpenGLRenderWindow.cxx, but it's not immediately clear what's going on
> there. vtkCameraPass::Render() in vtkCameraPass.cxx is definitely doing
> projection stuff but I'm not immediately understanding it.
>
>
Following some of these methods that may make the logic clear
vtkRenderWindow::DoStereoRender(); (sets LeftEye 1 or 0)
vtkOpenGLCamera::Render(); (calls vtkCamera::ComputeProjectionTransform();
which calls + vtkCamera::ComputeViewTransform())
vtkCamera::ComputeOffAxisProjectionFrustum(); (called from
vtkCamer::ComputeProjectionTransform() uses the LeftEye value for computing
projection matrix)
> My question is this: is there a good source for understanding the
> architecture of the camera handling and projection handling in ParaView? If
> not, would it be possible to get a high level rundown that would let me
> understand the details of what is going on? My experience has generally led
> me to believe that to get the best stereo you need to have a separate
> projection (GL_PROJECTION matrix) for each eye as well as a separate eye
> position (GL_MODELVIEW matrix) for each eye, and the projection for each eye
> needs to be off-axis. And the projection needs to be parameterized by both
> an interpupilary distance and the physical size of the projection screen
> (i.e. rendering window). Of course, it's possible to do all the matrix
> calculations (model view and projection) on the cpu side and stuff the
> resulting matrix into the OpenGL state however you like--I'm wondering if
> ParaView is doing this but I can't yet tell. I think if I get a high-level
> understanding of the cameras and projection code as it is, I'll better
> understand how the projections are being handled.
>
>
Unfortunately there is no such document which gives the high level rundown.
However I think the current implementation does all of what you need and you
will find methods to do that in vtkCamera (see
VTK/Rendering/Testing/Cxx/TestOffAxisStereo.cxx). Unfortunately Paraview
does not use this stereo by default and this is currently used for the CAVE
support in PV.
> Thanks for any help!
>
>
> Hope this helps.
-nix
> ______________________________**_________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/**
> opensource/opensource.html<http://www.kitware.com/opensource/opensource.html>
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/**ParaView <http://paraview.org/Wiki/ParaView>
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/**mailman/listinfo/paraview<http://www.paraview.org/mailman/listinfo/paraview>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20110808/96c71d6a/attachment.htm>
More information about the ParaView
mailing list