[vtkusers] Depth peeling and Qt

Sankhesh Jhaveri sankhesh.jhaveri at kitware.com
Fri Jan 12 10:46:19 EST 2018


Hi Ignacio,

I totally overlooked that you are using VTK 6.2.
As Shawn pointed out, VTK gained better Qt5 support with QVTKOpenGLWidget
which was added in 8.0.

Hth,
Sankhesh
​

On Fri, Jan 12, 2018 at 9:55 AM Shawn Waldon <shawn.waldon at kitware.com>
wrote:

> Hi Ignacio,
>
> IIRC, VTK 6.2 was before VTK had real support for Qt5 and there were still
> some major issues with VTK + Qt5 (as you have noticed).  You will either
> have to backport changes or update to a newer VTK.  I think VTK 8.1 may be
> the first release since QVTKOpenGLWidget (full Qt5 support) was added,
> although it may have been in 8.0.  You could try backporting
> QVTKOpenGLWidget, but I'm not sure how difficult that will be (it requires
> Qt 5.5 or 5.6 minimum I think).  Also, QVTKOpenGLWidget only works with the
> newer "OpenGL2" rendering backend which was still experimental in VTK 6.2.
> So you may have trouble with that too.  Your easiest approach would
> probably be to use a newer VTK.
>
> HTH,
> Shawn
>
> On Fri, Jan 12, 2018 at 8:48 AM, Sankhesh Jhaveri <
> sankhesh.jhaveri at kitware.com> wrote:
>
>> Hi Ignacio,
>>
>> In general, depth peeling is known to work with VTK and Qt5.
>> Are you using the QVTKOpenGLWidget
>> <https://www.vtk.org/doc/nightly/html/classQVTKOpenGLWidget.html>?
>> Could you post your modifications somewhere for us to see?
>>
>> Thanks,
>> Sankhesh
>>>>
>> On Fri, Jan 12, 2018 at 7:45 AM Ignacio Fernández Galván via vtkusers <
>> vtkusers at vtk.org> wrote:
>>
>>> Hi all,
>>>
>>> I'm trying to get depth peeling and Qt interface to work together with
>>> VTK 6.2.0 (Ubuntu 16.04) and python, and I'm not having much success.
>>>
>>> Depth peeling with "plain" VTK works fine
>>> (
>>> http://vtk.1045678.n5.nabble.com/Enable-depth-peeling-after-initialization-td5746070.html
>>> ),
>>> but then problems start
>>>
>>> I can't try PyQt4 because "import vtk" crashes (see
>>> https://gitlab.kitware.com/vtk/vtk/issues/16009).
>>>
>>> So I modified
>>> https://www.vtk.org/Wiki/VTK/Examples/Python/Widgets/EmbedPyQt to work
>>> with PyQt5. I also modified QVTKRenderWindowInteractor to use PyQt5 and
>>> configure the RenderWindow with:
>>>
>>> self._RenderWindow.SetMultiSamples(0)
>>> self._RenderWindow.SetAlphaBitPlanes(1)
>>>
>>> but (a): the sphere looks weird, like some facets being inside out and
>>> not being rendered, and (b): depth peeling is not enabled with the
>>> translucent object that works without Qt.
>>>
>>> If I use an external (non-Qt) render window, it works fine, but then the
>>> event loop conflicts with Qt and I get a working VTK window and a frozen
>>> Qt interface.
>>>
>>> I would appreciate some help or a working example, or even the assertion
>>> that it will never work.
>>>
>>> Thanks,
>>> Ignacio
>>> _______________________________________________
>>> 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:
>>> https://vtk.org/mailman/listinfo/vtkusers
>>>
>>
>>
>> --
>> Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware
>> <http://www.kitware.com/> | (518) 881-4417
>>>>
>> _______________________________________________
>> 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:
>> https://vtk.org/mailman/listinfo/vtkusers
>>
>>
>

-- 
Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware
<http://www.kitware.com/> | (518) 881-4417
​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180112/6b5d5740/attachment.html>


More information about the vtkusers mailing list