Kitware / LookingGlassVTKModule

Other
15 stars 12 forks source link

Put common render code in a RenderQuilt() function #32

Closed psavery closed 2 years ago

psavery commented 2 years ago

This moves common rendering code into a vtkLookingGlassInterface::RenderQuilt() function. The common rendering code is being moved from three places:

  1. vtkLookingGlassPass::Render()
  2. vtkLookingGlassRenderWindowImpl::DoStereoRender()
  3. The ParaView plugin

An optional renderFunc argument was added specifically for the vtkLookingGlassPass case, where instead of calling Render() on the renderers as the other two cases do, it needs to call Render() on its DelegatePass with a separate vtkRenderState* argument.

I tried to also look into resizing the render window (to match the RenderSize) inside the RenderQuilt() function. This would work for the ParaView plugin, which has separate render windows for rendering the quilt and rendering to the display, but:

  1. For the vtkLookingGlassPass, it appears that we do not want to resize the render window. I'm not entirely sure why.
  2. For the vtkLookingGlassRenderWindowImpl, we have to bypass SetSize() on the render window, at least for Linux (which uses vtkXOpenGLRenderWindow), because this otherwise causes a re-render when we do not want it, and a resulting render flash on the display.

So for the ParaView plugin and for the render window implementation, we fix the size ourselves outside of the RenderQuilt() function.

This is working in my tests for all three cases.

The corresponding ParaView MR is here.

I have tested these locally only on Linux, but I am able to also test on Mac as well.

psavery commented 2 years ago

This is ready for review.

psavery commented 2 years ago

I actually don't have permission to merge. Can someone give me permission or merge for me?

@cquammen

cquammen commented 2 years ago

Try now, @psavery

cjh1 commented 2 years ago

@cquammen Could I get permissions as well please?

cquammen commented 2 years ago

@cjh1 all set

aylward commented 1 year ago

I don't have permission to add you. I think you should merge to get credit/blame :). Cory?

On Mon, Apr 18, 2022 at 10:58 AM Patrick Avery @.***> wrote:

I actually don't have permission to merge. Can someone give me permission or merge for me?

@cquammen https://github.com/cquammen

— Reply to this email directly, view it on GitHub https://github.com/Kitware/LookingGlassVTKModule/pull/32#issuecomment-1101473661, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACEJL45E2CLCXKMFM76B3DVFV2BDANCNFSM5TL4IETQ . You are receiving this because you commented.Message ID: @.***>

-- Stephen R. Aylward, Ph.D. Senior Director of Strategic Initiatives

Kitware: Delivering innovation.

cquammen commented 1 year ago

@aylward we resolved giving @cjh1 permission back in April. I think that is what you are referring to here.