[vtkusers] Advice on mitigating choppy resize with Qt 5 + VTK 7.1

Elvis Stansvik elvis.stansvik at orexplore.com
Tue Mar 7 09:58:24 EST 2017


2017-03-07 15:53 GMT+01:00 David Cole <DLRdave at aol.com>:
> On Windows, we make resizing our windows interactive by getting the
> vtkInteractorStyle associated with the render window containing the
> volume rendering, and then calling StartState at resize begin time
> (OnEnterSizeMove) and StopState at resize end time (OnExitSizeMove).
>
> I suppose there may be a Qt equivalent which works on many platforms
> for beginning and ending a resize action. If not, there are definitely
> platform-specific hooks you can intercept to achieve smooth resizing
> with this technique.
>
> Wrapping anything in a StartState/StopState pair on the
> vtkInteractorStyle will cause "interactive frame rate rendering" to be
> in effect in between the calls. The volume rendering is not as nice
> looking during interactions, but it is definitely speedier.

Ah, I was just about to reply to myself with some further information:

I know that during interaction, the quality of the rendering is
decreased, and that this can account for some of the performance
discrepancy I'm seeing between camera movement vs window resize.

But, I've experimented with disabling the quality degradation during
interactions (so that the two should be on "equal footing"), and the
resizing is still much more choppy than when interacting with the
camera. So there must be something else.

In fact, in the screencast I showed, I wasn't using the volume
renderer's default built-in quality degradation during interaction.
I'm using my own since I've found that VTKs own is a little too
aggressive in degrading the quality to maintain frame rate.

Elvis

>
>
> HTH,
> David C.
>
>
>
> On Tue, Mar 7, 2017 at 9:33 AM, Elvis Stansvik
> <elvis.stansvik at orexplore.com> wrote:
>> 2017-03-07 15:17 GMT+01:00 Elvis Stansvik <elvis.stansvik at orexplore.com>:
>>> Hi all,
>>>
>>> I'm using Qt 5.5.1 and VTK 7.1. The program has a couple of VTKWidget
>>> showing volume renderings, as well as a window with a chart.
>>
>> Actually, I'm able to reproduce this behavior when not using Qt at
>> all, but just a regular render window + interactor setup with a single
>> volume rendered. Camera interaction is nice and fast, but resizing the
>> window, the rendering is very choppy. I'm also getting
>>
>> Warning: In /buildbot/vtk7-builder/build/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx,
>> line 1207
>> vtkXOpenGLRenderWindow (0x1353a10): warning window did not resize in
>> the allotted time
>>
>> printed to the console, so it seems VTK detects what I'm seeing
>> visually. I did not get this warning printed in the Qt + VTK app.
>>
>> Elvis
>>
>>>
>>> Have a look at the attached screen recording. Notice how camera
>>> interaction in both VTK render windows is nice and smooth, but when
>>> resizing the windows, the updating of the renderings is very
>>> slow/choppy.
>>>
>>> I've been trying to debug this, or at least finding a way of
>>> mitigating it. Could it be that Qt is delivering too many resize
>>> events? Has anyone else dealt with this problem?
>>>
>>> Thanks in advance for any advice,
>>> Elvis
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers


More information about the vtkusers mailing list