<div>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.</div>
<div><br></div><div>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.</div>
<div><br></div><div>The relevent code changes for anyone experiencing the same problem are as follows:</div><div><br></div><div>...<br>from PyQt4 import QtCore, QtGui, QtOpenGL<br>...<br>class QVTKRenderWidget(QtOpenGL.QGLWidget):<br>
...<br>...instead of<br>... apply(QtOpenGL.QGLWidget.__init__, (glFormat,self,parent) + args)<br>...<br> glFormat = QtOpenGL.QGLFormat()<br> glFormat.setAlpha(True)<br> QtOpenGL.QGLWidget.__init__(self,glFormat,parent,*args)<br>
...<br></div><div><br></div><div><br></div><div>On 18 August 2010 10:30, Daniel Lea <span dir="ltr"><<a href="mailto:danlea@gmail.com">danlea@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I'm not sure I made it clear actually, the module I'm using is QVTKRenderWidget.py. Has this been tested with depth peeling?<div><div class="h5"><br><br><div class="gmail_quote">On 17 August 2010 22:10, Daniel Lea <span dir="ltr"><<a href="mailto:danlea@gmail.com" target="_blank">danlea@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Well that's what I was concerned about. Setting it immediately after the python call:<br></div><div><br></div>
<div>self._RenderWindow = vtk.vtkRenderWindow()</div><div>self._RenderWindow.SetAlphaBitPlanes(1)</div>
<div><br></div><div>It must be the python module that's the problem? I'll see what I can do.</div><div><div><div><br></div><br><div class="gmail_quote">On 17 August 2010 21:58, Clinton Stimpson <span dir="ltr"><<a href="mailto:clinton@elemtech.com" target="_blank">clinton@elemtech.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><div><div>On Aug 17, 2010, at 12:09 PM, Daniel Lea wrote:</div><br>
<blockquote type="cite">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?<br>
</blockquote><div><br></div></div><div>Is AlphaBitPlanes being set before the window is initialized?</div><div>I tried it on an example using QVTKWidget, and it worked fine for me.</div><div><br></div><div>Clint</div><br>
<blockquote type="cite"><div><div>
<br><div class="gmail_quote">On 17 August 2010 15:32, Daniel Lea <span dir="ltr"><<a href="mailto:danlea@gmail.com" target="_blank">danlea@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>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.<br>
</div><div><br></div><div>Cheers,</div><div><br></div><div>Dan.</div><div><div><div><br></div><br><div class="gmail_quote">On 16 August 2010 18:11, Francois Bertel <span dir="ltr"><<a href="mailto:francois.bertel@kitware.com" target="_blank">francois.bertel@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Dan,<br>
<br>
The best way to ask a question is to post it on the vtkusers list. You<br>
will have a larger audience of people that can answer you:<br>
<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br>
To answer your question: make sure you have VTKData and your VTK build<br>
directory points to VTKData, what is the result of:<br>
$ ctest -R TestTranslucentLUTDepthPeeling -V<br>
<br>
Does it say "Depth peeling was used", like here:<br>
<a href="http://www.cdash.org/CDash/testDetails.php?test=62870189&build=694461" target="_blank">http://www.cdash.org/CDash/testDetails.php?test=62870189&build=694461</a><br>
<br>
<br>
On Mon, Aug 16, 2010 at 12:57 PM, Dan Lea <<a href="mailto:danlea@gmail.com" target="_blank">danlea@gmail.com</a>> wrote:<br>
> Hi François, I'm sure this isn't the best way to contact you directly,<br>
> but it's the only one I've found so far.<br>
><br>
> I'm having trouble getting depth peeling to work on my linux system<br>
> (python vtk bindings in a Qt widget, dual nvidia quadro nvs 290, latest<br>
> nvidia drivers), despite what appears to be full suport for it. Can you<br>
> think of any reason that the renderer would not use depth peeling,<br>
> having set everything correctly according to your documentation, and<br>
> given that<br>
> vtk.vtkOpenGLExtensionManager.ExtensionSupported("GL_VERSION_2_0")<br>
> returns 1 (as well as GL_ARB_texture_rectangle), and<br>
> glGetIntegerv(0x0D55) ("GL_ALPHA_BITS") returns 8?<br>
><br>
> Thanks in advance. Dan.<br>
><br>
> Here are the details of the window and renderer after a render:<br>
><br>
> vtkXOpenGLRenderWindow (0x7f7e088ae550)<br>
> Debug: Off<br>
> Modified Time: 223311<br>
> Reference Count: 1<br>
> Registered Events:<br>
> Registered Observers:<br>
> vtkObserver (0x3e958a0)<br>
> Event: 2<br>
> EventName: DeleteEvent<br>
> Command: 0x4039cd0<br>
> Priority: 0<br>
> Tag: 4<br>
> vtkObserver (0x4038d70)<br>
> Event: 2<br>
> EventName: DeleteEvent<br>
> Command: 0x403cdb0<br>
> Priority: 0<br>
> Tag: 5<br>
> vtkObserver (0x3e884a0)<br>
> Event: 2<br>
> EventName: DeleteEvent<br>
> Command: 0x403fde0<br>
> Priority: 0<br>
> Tag: 6<br>
> vtkObserver (0x403f740)<br>
> Event: 2<br>
> EventName: DeleteEvent<br>
> Command: 0x4042e90<br>
> Priority: 0<br>
> Tag: 7<br>
> vtkObserver (0x4042c90)<br>
> Event: 2<br>
> EventName: DeleteEvent<br>
> Command: 0x4045f50<br>
> Priority: 0<br>
> Tag: 8<br>
> vtkObserver (0x4045d50)<br>
> Event: 2<br>
> EventName: DeleteEvent<br>
> Command: 0x4047d80<br>
> Priority: 0<br>
> Tag: 9<br>
> vtkObserver (0x4c7ce40)<br>
> Event: 2<br>
> EventName: DeleteEvent<br>
> Command: 0x404b130<br>
> Priority: 0<br>
> Tag: 10<br>
> vtkObserver (0x4c8c290)<br>
> Event: 2<br>
> EventName: DeleteEvent<br>
> Command: 0x404e140<br>
> Priority: 0<br>
> Tag: 11<br>
> vtkObserver (0x4c97ae0)<br>
> Event: 2<br>
> EventName: DeleteEvent<br>
> Command: 0x4051150<br>
> Priority: 0<br>
> Tag: 12<br>
> vtkObserver (0x4ca60f0)<br>
> Event: 2<br>
> EventName: DeleteEvent<br>
> Command: 0x4054160<br>
> Priority: 0<br>
> Tag: 13<br>
> vtkObserver (0x4cb3160)<br>
> Event: 2<br>
> EventName: DeleteEvent<br>
> Command: 0x4047520<br>
> Priority: 0<br>
> Tag: 14<br>
> vtkObserver (0x40483c0)<br>
> Event: 2<br>
> EventName: DeleteEvent<br>
> Command: 0x3e817e0<br>
> Priority: 0<br>
> Tag: 15<br>
> vtkObserver (0x3f79810)<br>
> Event: 2<br>
> EventName: DeleteEvent<br>
> Command: 0x3e61f50<br>
> Priority: 0<br>
> Tag: 3<br>
> Erase: On<br>
> Window Name: Visualization Toolkit - OpenGL<br>
> Position: (0, 0)<br>
> Size: (1097, 747)<br>
> Mapped: 1<br>
> OffScreenRendering: 0<br>
> Double Buffered: 1<br>
> DPI: 120<br>
> TileScale: (1, 1)<br>
> TileViewport: (0, 0, 1, 1)<br>
> Borders: On<br>
> IsPicking: Off<br>
> Double Buffer: On<br>
> Full Screen: Off<br>
> Renderers:<br>
> Debug: Off<br>
> Modified Time: 6280<br>
> Reference Count: 1<br>
> Registered Events: (none)<br>
> Number Of Items: 1<br>
> Stereo Capable Window Requested: No<br>
> Stereo Render: Off<br>
> Point Smoothing: Off<br>
> Line Smoothing: Off<br>
> Polygon Smoothing: Off<br>
> Anti Aliased Frames: 0<br>
> Abort Render: 0<br>
> Current Cursor: 0<br>
> Desired Update Rate: 0.1<br>
> Focal Depth Frames: 0<br>
> In Abort Check: 0<br>
> NeverRendered: 0<br>
> Interactor: 0<br>
> Motion Blur Frames: 0<br>
> Swap Buffers: On<br>
> Stereo Type: RedBlue<br>
> Number of Layers: 1<br>
> AccumulationBuffer Size 0<br>
> AlphaBitPlanes: On<br>
> AnaglyphColorSaturation: 0.65<br>
> AnaglyphColorMask: 4 , 3<br>
> PainterDeviceAdapter:<br>
> Debug: Off<br>
> Modified Time: 5916<br>
> Reference Count: 1<br>
> Registered Events: (none)<br>
> MultiSamples: 0<br>
> StencilCapable: False<br>
> ReportGraphicErrors: Off<br>
> ContextId: 0x38f3f88<br>
> Color Map: 0<br>
> Display Id: 0x37d26a0<br>
> Next Window Id: 0<br>
> Window Id: 100664256<br>
><br>
> vtkOpenGLRenderer (0x7f7e088af540)<br>
> Debug: Off<br>
> Modified Time: 223310<br>
> Reference Count: 2<br>
> Registered Events: (none)<br>
> Aspect: (1.46854, 1)<br>
> PixelAspect: (1, 1)<br>
> Background: (0, 0, 0)<br>
> Background2: (0.2, 0.2, 0.2)<br>
> GradientBackground: Off<br>
> Viewport: (0, 0, 1, 1)<br>
> Displaypoint: (0, 0, 0)<br>
> Viewpoint: (0, 0, 0)<br>
> Worldpoint: (0, 0, 0, 0)<br>
> Pick Position X1 Y1: -1 -1<br>
> Pick Position X2 Y2: -1 -1<br>
> IsPicking boolean: 0<br>
> Props:<br>
> Debug: Off<br>
> Modified Time: 226173<br>
> Reference Count: 1<br>
> Registered Events: (none)<br>
> Number Of Items: 13<br>
> PickResultProps:<br>
> NULL<br>
> Near Clipping Plane Tolerance: 0.001<br>
> Ambient: (1, 1, 1)<br>
> Backing Store: Off<br>
> Display Point: (0, 0, 0)<br>
> Lights:<br>
> Debug: Off<br>
> Modified Time: 25331<br>
> Reference Count: 1<br>
> Registered Events: (none)<br>
> Number Of Items: 1<br>
> Light Follow Camera: On<br>
> View Point: (0, 0, 0)<br>
> Two Sided Lighting: On<br>
> Automatic Light Creation: On<br>
> Layer = 0<br>
> Interactive = On<br>
> Allocated Render Time: 10<br>
> Last Time To Render (Seconds): 0.075882<br>
> TimeFactor: 131.784<br>
> Erase: On<br>
> Draw: On<br>
> UseDepthPeeling: On<br>
> OcclusionRation: 0.1<br>
> MaximumNumberOfPeels: 4<br>
> LastRenderingUsedDepthPeeling: Off<br>
> Number Of Lights Bound: 1<br>
> PickBuffer 0<br>
> PickedId0<br>
> NumPicked0<br>
> PickedZ 0<br>
> --<br>
> This message was sent from Launchpad by the user<br>
> Dan Lea (<a href="https://launchpad.net/~danlea" target="_blank">https://launchpad.net/~danlea</a>)<br>
> using the "Contact this user" link on your profile page.<br>
> For more information see<br>
> <a href="https://help.launchpad.net/YourAccount/ContactingPeople" target="_blank">https://help.launchpad.net/YourAccount/ContactingPeople</a><br>
><br>
<font color="#888888"><br>
<br>
<br>
--<br>
François Bertel, PhD | Kitware Inc. Suite 204<br>
1 (518) 371 3971 x113 | 28 Corporate Drive<br>
| Clifton Park NY 12065, USA<br>
</font></blockquote></div><br>
</div></div></blockquote></div><br></div></div>
_______________________________________________<br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<div><br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br></div></blockquote></div><br></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>