[vtkusers] vtkRenderWindow DoFdRender causes camera vibration

Zsolt V vtkzsolt at gmail.com
Tue Jul 10 08:58:51 EDT 2012


Hi,

rendering focal depth frames is a great feature of VTK. However, the random
offsets in vtkRenderWindow::DoFDRender() add a very annoying vibration to
it. Let's say we would like to create a simple video of moving the focal
point smoothly from a frontal object to an object in the background. At the
beginning the frontal object is sharp, the background is blurred, while at
the end it is swapped. It should be easily done in VTK by focal depth
rendering and changing only the distance of the focal point. But due to the
fact that for each rendered frames new random offsets are calculated for
radius and angle ( in vtkRenderWindow::DoFDRender() ), the result is a
camera vibrating.

More simply: when focal depth rendering is turned on, each rendering yields
a different image, even if camera and scene do not change at all.

I would change vtkRenderWindow to calculate these random numbers only when
the SetFDFrames method is invoked, and store them for each FDFrames
separately. In DoFDRender these pre-generated random numbers can be used,
hence they won't vary each time the method Render() is called.

My problem is that I don't know how to create a subclass of vtkRenderWindow
without loosing all the methods re-implemented in its subclasses
(vtkOpenGLRenderWindow, and so on). I want my code to be portable, so it is
not sufficient to create a subclass of vtkXOpenGLRenderWindow, for example.
But if a class inherits vtkRenderWindow, all specific classes will not be
its subclass any longer.

Is there a solution for it without subclassing all RenderWindow classes?

Thanks,
Zsolt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120710/f0ebf320/attachment.htm>


More information about the vtkusers mailing list