[vtkusers] Depth peeling not used, but I can't see why.

Daniel Lea danlea at gmail.com
Wed Aug 18 09:45:16 EDT 2010


It seems the problem is related to using a QWidget within a Qt application
window.  Firstly I tried using QVTKRenderWindowInteractor.py is a base class
for the graphics window of the application, fiddled around without managing
to get it to work within the application window (got x errors and segfaults
instead of a render), but upon creating its own pop-up window (i.e. one
external to the application QMainWindow), it had an alpha buffer and
depth-peeling worked.

I've actually now circumvented the problem by modifying QVTKRenderWidget.py
to inherit QtOpenGL.QGLWidget instead of a plain QWidget, passing an alpha
buffer enabled QGLFormat for initialisation, and it works fine.

The relevent code changes for anyone experiencing the same problem are as
follows:

...
from PyQt4 import QtCore, QtGui, QtOpenGL
...
class QVTKRenderWidget(QtOpenGL.QGLWidget):
...
...instead of
... apply(QtOpenGL.QGLWidget.__init__, (glFormat,self,parent) + args)
...
    glFormat = QtOpenGL.QGLFormat()
    glFormat.setAlpha(True)
    QtOpenGL.QGLWidget.__init__(self,glFormat,parent,*args)
...


On 18 August 2010 10:30, Daniel Lea <danlea at gmail.com> wrote:

> I'm not sure I made it clear actually, the module I'm using is
> QVTKRenderWidget.py.  Has this been tested with depth peeling?
>
>
> On 17 August 2010 22:10, Daniel Lea <danlea at gmail.com> wrote:
>
>> Well that's what I was concerned about.  Setting it immediately after the
>> python call:
>>
>> self._RenderWindow = vtk.vtkRenderWindow()
>> self._RenderWindow.SetAlphaBitPlanes(1)
>>
>> It must be the python module that's the problem?  I'll see what I can do.
>>
>>
>> On 17 August 2010 21:58, Clinton Stimpson <clinton at elemtech.com> wrote:
>>
>>>
>>> On Aug 17, 2010, at 12:09 PM, Daniel Lea wrote:
>>>
>>> OK, now I've realised you can get some debug output with a standard build
>>> using the DebugOn() method in the right objects, I've determined that in my
>>> QVTKWidget, there are zero alpha bits, which is why depth peeling is not
>>> used (note that AlphaBitPlanes is definitely set).  I'm trying to find out
>>> how to resolve this, but perhaps someone has already come across this
>>> problem and sorted it out?
>>>
>>>
>>> Is AlphaBitPlanes being set before the window is initialized?
>>> I tried it on an example using QVTKWidget, and it worked fine for me.
>>>
>>> Clint
>>>
>>>
>>> On 17 August 2010 15:32, Daniel Lea <danlea at gmail.com> wrote:
>>>
>>>> Please see below for details of the problem.  Having run the depth
>>>> peeling test using a separate build of vtk (same version as my Ubuntu
>>>> package: 5.2.1), the result is a failure (seems the front panel isn't
>>>> translucent) but it does say that depth peeling was used.  I'd rather not
>>>> have to configure a build for the application in order to debug vtk, so if
>>>> anyone has any ideas why depth peeling might not be used in the application,
>>>> do get in touch.
>>>>
>>>> Cheers,
>>>>
>>>> Dan.
>>>>
>>>>
>>>> On 16 August 2010 18:11, Francois Bertel <francois.bertel at kitware.com>wrote:
>>>>
>>>>> Hi Dan,
>>>>>
>>>>> The best way to ask a question is to post it on the vtkusers list. You
>>>>> will have a larger audience of people that can answer you:
>>>>>
>>>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>>>
>>>>> To answer your question: make sure you have VTKData and your VTK build
>>>>> directory points to VTKData, what is the result of:
>>>>> $ ctest -R TestTranslucentLUTDepthPeeling -V
>>>>>
>>>>> Does it say "Depth peeling was used", like here:
>>>>> http://www.cdash.org/CDash/testDetails.php?test=62870189&build=694461
>>>>>
>>>>>
>>>>> On Mon, Aug 16, 2010 at 12:57 PM, Dan Lea <danlea at gmail.com> wrote:
>>>>> > Hi François, I'm sure this isn't the best way to contact you
>>>>> directly,
>>>>> > but it's the only one I've found so far.
>>>>> >
>>>>> > I'm having trouble getting depth peeling to work on my linux system
>>>>> > (python vtk bindings in a Qt widget, dual nvidia quadro nvs 290,
>>>>> latest
>>>>> > nvidia drivers), despite what appears to be full suport for it.  Can
>>>>> you
>>>>> > think of any reason that the renderer would not use depth peeling,
>>>>> > having set everything correctly according to your documentation, and
>>>>> > given that
>>>>> > vtk.vtkOpenGLExtensionManager.ExtensionSupported("GL_VERSION_2_0")
>>>>> > returns 1 (as well as GL_ARB_texture_rectangle), and
>>>>> > glGetIntegerv(0x0D55) ("GL_ALPHA_BITS") returns 8?
>>>>> >
>>>>> > Thanks in advance.  Dan.
>>>>> >
>>>>> > Here are the details of the window and renderer after a render:
>>>>> >
>>>>> > vtkXOpenGLRenderWindow (0x7f7e088ae550)
>>>>> >  Debug: Off
>>>>> >  Modified Time: 223311
>>>>> >  Reference Count: 1
>>>>> >  Registered Events:
>>>>> >    Registered Observers:
>>>>> >      vtkObserver (0x3e958a0)
>>>>> >        Event: 2
>>>>> >        EventName: DeleteEvent
>>>>> >        Command: 0x4039cd0
>>>>> >        Priority: 0
>>>>> >        Tag: 4
>>>>> >      vtkObserver (0x4038d70)
>>>>> >        Event: 2
>>>>> >        EventName: DeleteEvent
>>>>> >        Command: 0x403cdb0
>>>>> >        Priority: 0
>>>>> >        Tag: 5
>>>>> >      vtkObserver (0x3e884a0)
>>>>> >        Event: 2
>>>>> >        EventName: DeleteEvent
>>>>> >        Command: 0x403fde0
>>>>> >        Priority: 0
>>>>> >        Tag: 6
>>>>> >      vtkObserver (0x403f740)
>>>>> >        Event: 2
>>>>> >        EventName: DeleteEvent
>>>>> >        Command: 0x4042e90
>>>>> >        Priority: 0
>>>>> >        Tag: 7
>>>>> >      vtkObserver (0x4042c90)
>>>>> >        Event: 2
>>>>> >        EventName: DeleteEvent
>>>>> >        Command: 0x4045f50
>>>>> >        Priority: 0
>>>>> >        Tag: 8
>>>>> >      vtkObserver (0x4045d50)
>>>>> >        Event: 2
>>>>> >        EventName: DeleteEvent
>>>>> >        Command: 0x4047d80
>>>>> >        Priority: 0
>>>>> >        Tag: 9
>>>>> >      vtkObserver (0x4c7ce40)
>>>>> >        Event: 2
>>>>> >        EventName: DeleteEvent
>>>>> >        Command: 0x404b130
>>>>> >        Priority: 0
>>>>> >        Tag: 10
>>>>> >      vtkObserver (0x4c8c290)
>>>>> >        Event: 2
>>>>> >        EventName: DeleteEvent
>>>>> >        Command: 0x404e140
>>>>> >        Priority: 0
>>>>> >        Tag: 11
>>>>> >      vtkObserver (0x4c97ae0)
>>>>> >        Event: 2
>>>>> >        EventName: DeleteEvent
>>>>> >        Command: 0x4051150
>>>>> >        Priority: 0
>>>>> >        Tag: 12
>>>>> >      vtkObserver (0x4ca60f0)
>>>>> >        Event: 2
>>>>> >        EventName: DeleteEvent
>>>>> >        Command: 0x4054160
>>>>> >        Priority: 0
>>>>> >        Tag: 13
>>>>> >      vtkObserver (0x4cb3160)
>>>>> >        Event: 2
>>>>> >        EventName: DeleteEvent
>>>>> >        Command: 0x4047520
>>>>> >        Priority: 0
>>>>> >        Tag: 14
>>>>> >      vtkObserver (0x40483c0)
>>>>> >        Event: 2
>>>>> >        EventName: DeleteEvent
>>>>> >        Command: 0x3e817e0
>>>>> >        Priority: 0
>>>>> >        Tag: 15
>>>>> >      vtkObserver (0x3f79810)
>>>>> >        Event: 2
>>>>> >        EventName: DeleteEvent
>>>>> >        Command: 0x3e61f50
>>>>> >        Priority: 0
>>>>> >        Tag: 3
>>>>> >  Erase: On
>>>>> >  Window Name: Visualization Toolkit - OpenGL
>>>>> >  Position: (0, 0)
>>>>> >  Size: (1097, 747)
>>>>> >  Mapped: 1
>>>>> >  OffScreenRendering: 0
>>>>> >  Double Buffered: 1
>>>>> >  DPI: 120
>>>>> >  TileScale: (1, 1)
>>>>> >  TileViewport: (0, 0, 1, 1)
>>>>> >  Borders: On
>>>>> >  IsPicking: Off
>>>>> >  Double Buffer: On
>>>>> >  Full Screen: Off
>>>>> >  Renderers:
>>>>> >    Debug: Off
>>>>> >    Modified Time: 6280
>>>>> >    Reference Count: 1
>>>>> >    Registered Events: (none)
>>>>> >    Number Of Items: 1
>>>>> >  Stereo Capable Window Requested: No
>>>>> >  Stereo Render: Off
>>>>> >  Point Smoothing: Off
>>>>> >  Line Smoothing: Off
>>>>> >  Polygon Smoothing: Off
>>>>> >  Anti Aliased Frames: 0
>>>>> >  Abort Render: 0
>>>>> >  Current Cursor: 0
>>>>> >  Desired Update Rate: 0.1
>>>>> >  Focal Depth Frames: 0
>>>>> >  In Abort Check: 0
>>>>> >  NeverRendered: 0
>>>>> >  Interactor: 0
>>>>> >  Motion Blur Frames: 0
>>>>> >  Swap Buffers: On
>>>>> >  Stereo Type: RedBlue
>>>>> >  Number of Layers: 1
>>>>> >  AccumulationBuffer Size 0
>>>>> >  AlphaBitPlanes: On
>>>>> >  AnaglyphColorSaturation: 0.65
>>>>> >  AnaglyphColorMask: 4 , 3
>>>>> >  PainterDeviceAdapter:
>>>>> >    Debug: Off
>>>>> >    Modified Time: 5916
>>>>> >    Reference Count: 1
>>>>> >    Registered Events: (none)
>>>>> >  MultiSamples: 0
>>>>> >  StencilCapable: False
>>>>> >  ReportGraphicErrors: Off
>>>>> >  ContextId: 0x38f3f88
>>>>> >  Color Map: 0
>>>>> >  Display Id: 0x37d26a0
>>>>> >  Next Window Id: 0
>>>>> >  Window Id: 100664256
>>>>> >
>>>>> > vtkOpenGLRenderer (0x7f7e088af540)
>>>>> >  Debug: Off
>>>>> >  Modified Time: 223310
>>>>> >  Reference Count: 2
>>>>> >  Registered Events: (none)
>>>>> >  Aspect: (1.46854, 1)
>>>>> >  PixelAspect: (1, 1)
>>>>> >  Background: (0, 0, 0)
>>>>> >  Background2: (0.2, 0.2, 0.2)
>>>>> >  GradientBackground: Off
>>>>> >  Viewport: (0, 0, 1, 1)
>>>>> >  Displaypoint: (0, 0, 0)
>>>>> >  Viewpoint: (0, 0, 0)
>>>>> >  Worldpoint: (0, 0, 0, 0)
>>>>> >  Pick Position X1 Y1: -1 -1
>>>>> >  Pick Position X2 Y2: -1 -1
>>>>> >  IsPicking boolean: 0
>>>>> >  Props:
>>>>> >    Debug: Off
>>>>> >    Modified Time: 226173
>>>>> >    Reference Count: 1
>>>>> >    Registered Events: (none)
>>>>> >    Number Of Items: 13
>>>>> >  PickResultProps:
>>>>> >  NULL
>>>>> >  Near Clipping Plane Tolerance: 0.001
>>>>> >  Ambient: (1, 1, 1)
>>>>> >  Backing Store: Off
>>>>> >  Display Point: (0, 0, 0)
>>>>> >  Lights:
>>>>> >    Debug: Off
>>>>> >    Modified Time: 25331
>>>>> >    Reference Count: 1
>>>>> >    Registered Events: (none)
>>>>> >    Number Of Items: 1
>>>>> >  Light Follow Camera: On
>>>>> >  View Point: (0, 0, 0)
>>>>> >  Two Sided Lighting: On
>>>>> >  Automatic Light Creation: On
>>>>> >  Layer = 0
>>>>> >  Interactive = On
>>>>> >  Allocated Render Time: 10
>>>>> >  Last Time To Render (Seconds): 0.075882
>>>>> >  TimeFactor: 131.784
>>>>> >  Erase: On
>>>>> >  Draw: On
>>>>> >  UseDepthPeeling: On
>>>>> >  OcclusionRation: 0.1
>>>>> >  MaximumNumberOfPeels: 4
>>>>> >  LastRenderingUsedDepthPeeling: Off
>>>>> >  Number Of Lights Bound: 1
>>>>> >  PickBuffer 0
>>>>> >  PickedId0
>>>>> >  NumPicked0
>>>>> >  PickedZ 0
>>>>> > --
>>>>> > This message was sent from Launchpad by the user
>>>>> > Dan Lea (https://launchpad.net/~danlea)
>>>>> > using the "Contact this user" link on your profile page.
>>>>> > For more information see
>>>>> > https://help.launchpad.net/YourAccount/ContactingPeople
>>>>> >
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> François Bertel, PhD  | Kitware Inc. Suite 204
>>>>> 1 (518) 371 3971 x113 | 28 Corporate Drive
>>>>>                       | Clifton Park NY 12065, USA
>>>>>
>>>>
>>>>
>>> _______________________________________________
>>> 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
>>>
>>> Follow this link to subscribe/unsubscribe:
>>>
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>>
>>>
>>> _______________________________________________
>>> 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
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100818/5fc352a4/attachment.htm>


More information about the vtkusers mailing list