<div dir="ltr"><div>As you know, when a window is created for OpenGL, all of the necessary buffers have to be created in order for it to work. The function glXChooseVisual() is used to request a specific set of buffers. So a regular Qt widget does not call glxChooseVisual() and will therefore just get a "default" context, which may or may not have all the attributes that are needed for OpenGL rendering. If VTK's own call to glXChooseVisual() comes after Qt has already created the window, it might not be entirely successful.</div><div><br></div><div>Yes, please submit a patch or at least submit your changes to the list. I've used QGLWidget with VTK in the past, and my experience (on the systems that I was using at the time) was that it was less reliable than just using QWidget. The QGLWidget does a lot of stuff under-the-hood that doesn't fit perfectly with VTK.</div><div><br></div><div> - David</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 18, 2016 at 6:46 AM, Sophonet <span dir="ltr"><<a href="mailto:vtk12af6bc42@kant.sophonet.de" target="_blank">vtk12af6bc42@kant.sophonet.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It works! When deriving QVTKRenderWindowInteractor from PySide.QtOpenGL.QGLWidget instead of QWidget, the error messages regarding glDrawBuffer etc. disappear and depth test / rendering seems to be correct.<br>
<br>
I do not fully understand the potential cause of being a VMDriver issue, since (i) I would assume that this applies to the Cone - example as well (which works) and (ii) the rendering string reveals the Gallium llvm engine (a software renderer, which should not depend on the graphics driver). Nevermind, the good news that this seems to be resolved.<br>
<br>
The same change on MS Windows seems to work as well.<br>
<br>
However, the constructor of QGLWidget does not accept window flags (for MS windows MSWindowsOwnDC is currently set in the current QVTKRenderWindowInteractor.py), so I had to omit them and I cannot fully judge whether this change would create a problem for other scripts. However, I would think that deriving from an QGLWidget is actually a reasonable thing to do.<br>
<br>
David, what do you think about the wflag issue and do you think a patch can make it to VTK7? Shall I submit one?<br>
<br>
Thanks,<br>
<br>
Sophonet<div><div class="h5"><br>
<br>
<br>
Am 2016-01-18 14:15, schrieb David Gobbi:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
If you are running linux on a VM, you can try fiddling with the 3D<br>
acceleration settings in the VMWare manager (though I can't give any<br>
specific advice here, I haven't use VMWare recently). One<br>
possibility is that VMWare isn't creating a depth buffer on the client<br>
side. You can try some of the Qt OpenGL examples to see if they<br>
work, and if they do, you can try changing with<br>
the QVTKRenderWindow.py code to make it use a QGLWidget to create the<br>
VTK drawing context.<br>
<br>
- David<br>
<br>
On Mon, Jan 18, 2016 at 5:17 AM, Sophonet<br>
<<a href="mailto:vtk12af6bc42@kant.sophonet.de" target="_blank">vtk12af6bc42@kant.sophonet.de</a>> wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hi David,<br>
<br>
just tried it - the information you suggested is identical for<br>
Cone5.py (works, with vtkRenderWindowInteractor) and<br>
QVTKRenderWindow.py (depth problems). Info is attached below.<br>
<br>
Still, the error message<br>
<br>
Mesa: User error: GL_INVALID_OPERATION in<br>
glDrawBuffer(buffer=0x405)<br>
<br>
only occurs when starting QVTKRenderWindow.py (where the depth<br>
problems occur).<br>
<br>
Any more thoughts?<br>
<br>
Thanks,<br>
<br>
Fabian<br>
<br>
----<br>
<br>
Support OpenGL: 1<br>
<br>
IsDirect: 1<br>
<br>
server glx vendor string: SGI<br>
server glx version string: 1.2<br>
server glx extensions: GLX_ARB_multisample GLX_EXT_visual_info<br>
GLX_EXT_visual_rating GLX_EXT_import_context GLX_OML_swap_method<br>
GLX_SGI_make_current_read GLX_SGIS_multisample GLX_SGIX_hyperpipe<br>
GLX_SGIX_swap_barrier GLX_SGIX_fbconfig<br>
client glx vendor string: Mesa Project and SGI<br>
client glx version string: 1.4<br>
client glx extensions: GLX_ARB_create_context<br>
GLX_ARB_create_context_profile GLX_ARB_create_context_robustness<br>
GLX_ARB_fbconfig_float GLX_ARB_framebuffer_sRGB<br>
GLX_ARB_get_proc_address GLX_ARB_multisample GLX_EXT_import_context<br>
GLX_EXT_visual_info GLX_EXT_visual_rating<br>
GLX_EXT_fbconfig_packed_float GLX_EXT_framebuffer_sRGB<br>
GLX_EXT_create_context_es2_profile GLX_MESA_copy_sub_buffer<br>
GLX_MESA_multithread_makecurrent GLX_MESA_swap_control<br>
GLX_OML_swap_method GLX_OML_sync_control GLX_SGI_make_current_read<br>
GLX_SGI_swap_control GLX_SGI_video_sync GLX_SGIS_multisample<br>
GLX_SGIX_fbconfig GLX_SGIX_pbuffer GLX_SGIX_visual_select_group<br>
GLX_EXT_texture_from_pixmap GLX_INTEL_swap_event<br>
glx extensions: GLX_ARB_get_proc_address GLX_ARB_multisample<br>
GLX_EXT_import_context GLX_EXT_visual_info GLX_EXT_visual_rating<br>
GLX_MESA_multithread_makecurrent GLX_OML_swap_method<br>
GLX_SGI_make_current_read GLX_SGIS_multisample GLX_SGIX_fbconfig<br>
OpenGL vendor string: VMware, Inc.<br>
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.3, 128<br>
bits)<br>
OpenGL version string: 2.1 Mesa 9.2.3<br>
OpenGL extensions: GL_ARB_multisample GL_EXT_abgr GL_EXT_bgra<br>
GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_subtract<br>
GL_EXT_copy_texture GL_EXT_polygon_offset GL_EXT_subtexture<br>
GL_EXT_texture_object GL_EXT_vertex_array<br>
GL_EXT_compiled_vertex_array GL_EXT_texture GL_EXT_texture3D<br>
GL_IBM_rasterpos_clip GL_ARB_point_parameters<br>
GL_EXT_draw_range_elements GL_EXT_packed_pixels<br>
GL_EXT_point_parameters GL_EXT_rescale_normal<br>
GL_EXT_separate_specular_color GL_EXT_texture_edge_clamp<br>
GL_SGIS_generate_mipmap GL_SGIS_texture_border_clamp<br>
GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod<br>
GL_ARB_framebuffer_sRGB GL_ARB_multitexture GL_EXT_framebuffer_sRGB<br>
GL_IBM_multimode_draw_arrays GL_IBM_texture_mirrored_repeat<br>
GL_ARB_texture_cube_map GL_ARB_texture_env_add<br>
GL_ARB_transpose_matrix GL_EXT_blend_func_separate GL_EXT_fog_coord<br>
GL_EXT_multi_draw_arrays GL_EXT_secondary_color<br>
GL_EXT_texture_env_add GL_EXT_texture_lod_bias<br>
GL_INGR_blend_func_separate GL_NV_blend_square<br>
GL_NV_light_max_exponent GL_NV_texgen_reflection<br>
GL_NV_texture_env_combine4 GL_SUN_multi_draw_arrays<br>
GL_ARB_texture_border_clamp GL_ARB_texture_compression<br>
GL_EXT_framebuffer_object GL_EXT_texture_env_combine<br>
GL_EXT_texture_env_dot3 GL_MESA_window_pos<br>
GL_NV_packed_depth_stencil GL_NV_texture_rectangle<br>
GL_ARB_depth_texture GL_ARB_occlusion_query GL_ARB_shadow<br>
GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar<br>
GL_ARB_texture_env_dot3 GL_ARB_texture_mirrored_repeat<br>
GL_ARB_window_pos GL_EXT_stencil_two_side GL_EXT_texture_cube_map<br>
GL_NV_fog_distance GL_APPLE_packed_pixels<br>
GL_APPLE_vertex_array_object GL_ARB_draw_buffers<br>
GL_ARB_fragment_program GL_ARB_fragment_shader GL_ARB_shader_objects<br>
GL_ARB_vertex_program GL_ARB_vertex_shader GL_ATI_draw_buffers<br>
GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_EXT_shadow_funcs<br>
GL_EXT_stencil_wrap GL_MESA_pack_invert GL_MESA_ycbcr_texture<br>
GL_NV_primitive_restart GL_ARB_fragment_program_shadow<br>
GL_ARB_half_float_pixel GL_ARB_occlusion_query2 GL_ARB_point_sprite<br>
GL_ARB_shading_language_100 GL_ARB_sync<br>
GL_ARB_texture_non_power_of_two GL_ARB_vertex_buffer_object<br>
GL_ATI_blend_equation_separate GL_EXT_blend_equation_separate<br>
GL_OES_read_format GL_ARB_color_buffer_float<br>
GL_ARB_pixel_buffer_object GL_ARB_texture_compression_rgtc<br>
GL_ARB_texture_float GL_ARB_texture_rectangle<br>
GL_ATI_texture_compression_3dc GL_EXT_packed_float<br>
GL_EXT_pixel_buffer_object GL_EXT_texture_compression_rgtc<br>
GL_EXT_texture_mirror_clamp GL_EXT_texture_rectangle<br>
GL_EXT_texture_sRGB GL_EXT_texture_shared_exponent<br>
GL_ARB_framebuffer_object GL_EXT_framebuffer_blit<br>
GL_EXT_packed_depth_stencil GL_ARB_vertex_array_object<br>
GL_ATI_separate_stencil GL_ATI_texture_mirror_once<br>
GL_EXT_draw_buffers2 GL_EXT_draw_instanced<br>
GL_EXT_gpu_program_parameters GL_EXT_texture_array<br>
GL_EXT_texture_compression_latc GL_EXT_texture_integer<br>
GL_EXT_texture_sRGB_decode GL_EXT_timer_query GL_OES_EGL_image<br>
GL_MESA_texture_array GL_ARB_copy_buffer GL_ARB_depth_buffer_float<br>
GL_ARB_draw_instanced GL_ARB_half_float_vertex<br>
GL_ARB_instanced_arrays GL_ARB_map_buffer_range GL_ARB_texture_rg<br>
GL_ARB_texture_swizzle GL_ARB_vertex_array_bgra<br>
GL_EXT_texture_swizzle GL_EXT_vertex_array_bgra<br>
GL_NV_conditional_render GL_AMD_conservative_depth<br>
GL_AMD_draw_buffers_blend GL_ARB_ES2_compatibility<br>
GL_ARB_blend_func_extended GL_ARB_debug_output<br>
GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex<br>
GL_ARB_explicit_attrib_location GL_ARB_fragment_coord_conventions<br>
GL_ARB_provoking_vertex GL_ARB_sampler_objects<br>
GL_ARB_shader_texture_lod GL_ARB_texture_rgb10_a2ui<br>
GL_ARB_uniform_buffer_object GL_ARB_vertex_type_2_10_10_10_rev<br>
GL_EXT_provoking_vertex GL_EXT_texture_snorm<br>
GL_MESA_texture_signed_rgba GL_ARB_get_program_binary<br>
GL_ARB_robustness GL_ARB_shader_bit_encoding GL_ARB_timer_query<br>
GL_ARB_transform_feedback2 GL_ARB_transform_feedback3<br>
GL_ARB_conservative_depth GL_ARB_internalformat_query<br>
GL_ARB_shading_language_420pack GL_ARB_shading_language_packing<br>
GL_ARB_texture_storage GL_ARB_transform_feedback_instanced<br>
GL_EXT_transform_feedback GL_ARB_invalidate_subdata<br>
X Extensions: SHAPE, Extended-Visual-Information,<br>
XInputExtension, XTEST, BIG-REQUESTS, MIT-SUNDRY-NONSTANDARD,<br>
DEC-XTRAP, SYNC, XKEYBOARD, XC-MISC, RECORD, DOUBLE-BUFFER,<br>
XC-APPGROUP, SECURITY, TOG-CUP, GLX, SGI-GLX, XFIXES, RENDER, RANDR,<br>
X-Resource, XEVIE, DAMAGE<br>
<br>
Am 2016-01-15 23:01, schrieb David Gobbi:<br>
Hi Sophonet,<br>
<br>
You can try using the vtkRenderWindow to get info from the context,<br>
to<br>
see if it's different with QVTKRenderWindowInteractor than<br>
without.<br>
<br>
There are two boolean methods for vtkRenderWindow:<br>
window.SupportsOpenGL()<br>
window.IsDirect()<br>
<br>
And also this method that prints a bunch of info:<br>
print window.ReportCapabilities()<br>
<br>
You might have to all Render() once before calling these methods.<br>
<br>
- David<br>
<br>
On Fri, Jan 15, 2016 at 2:55 AM, Sophonet<br>
<<a href="mailto:vtk12af6bc42@kant.sophonet.de" target="_blank">vtk12af6bc42@kant.sophonet.de</a>> wrote:<br>
<br>
Hi David,<br>
<br>
The problem occurs as well when running<br>
QVTKRenderWindowInteractor.py directly.<br>
<br>
I have tried picking the Mesa software renderer to exclude a<br>
graphics driver problem by<br>
<br>
LIBGL_ALWAYS_SOFTWARE=1 GALLIUM_DRIVER=softpipe python<br>
PATHTO_/QVTKRenderWindowInteractor.py, but same problem.<br>
<br>
The software renderer is chosen by setting the two variables as I<br>
could verify with<br>
<br>
LIBGL_ALWAYS_SOFTWARE=1 GALLIUM_DRIVER=softpipe glxinfo:<br>
<br>
...<br>
OpenGL renderer string: Gallium 0.4 on softpipe<br>
OpenGL version string: 2.1 Mesa 9.2.3<br>
OpenGL shading language version string: 1.30<br>
...<br>
<br>
I have found a related thread here (8 years old):<br>
<br>
<a href="http://osdir.com/ml/python-enthought-devel/2008-04/msg00491.html" rel="noreferrer" target="_blank">http://osdir.com/ml/python-enthought-devel/2008-04/msg00491.html</a><br>
[1]<br>
[1]<br>
<br>
...but as opposed to the problem described there, I do not see<br>
warnings on a missing depth buffer when turning on MESA_DEBUG=1 -<br>
only the errors with respect to glDrawBuffer / glReadBuffer (see my<br>
previous e-mail)... and in order to rule out device driver<br>
problems,<br>
I have forced software rendering as mentioned above.<br>
<br>
I would be happy to debug further if I would know how.<br>
<br>
Thanks,<br>
<br>
sophonet<br>
<br>
Am 2016-01-14 21:39, schrieb David Gobbi:<br>
Hi Sophonet,<br>
<br>
QVTKRenderWindowInteractor.py has a "main" and can be run as an<br>
example. If you run it, does it show the same problem?<br>
<br>
I recently tried it with VTK 7.0.0.rc1 and didn't see any depth<br>
buffer<br>
issues (using Ubuntu 12.04).<br>
<br>
- David<br>
<br>
On Thu, Jan 14, 2016 at 1:17 PM, Sophonet<br>
<<a href="mailto:vtk12af6bc42@kant.sophonet.de" target="_blank">vtk12af6bc42@kant.sophonet.de</a>> wrote:<br>
<br>
Dear list,<br>
<br>
when trying to run a Qt Python application using the<br>
qt.QTVTKRenderWindow, there are depth test problems.<br>
<br>
Examples/Tutorial/Step1/Python/Cone.py works perfect, but with a<br>
simple QVTKRenderWindow example (based on<br>
</div></div><a href="https://gist.github.com/samueljohn/3090097" rel="noreferrer" target="_blank">https://gist.github.com/samueljohn/3090097</a> [2] [2] [1], needs two<div><div class="h5"><br>
more<br>
<br>
imports though), there are depth test problems, i.e. it appears<br>
that<br>
for some reason no depth test is applied (so the last drawn<br>
primitive is always visible on top).<br>
<br>
When doing<br>
<br>
export MESA_DEBUG=1<br>
<br>
before running the two scripts, there is one warning in the<br>
Examples/Tutorial/Step1/Python/Cone.py,<br>
<br>
Mesa warning: couldn't open libtxc_dxtn.so, software DXTn<br>
compression/decompression unavailable<br>
<br>
[but everything looks fine],<br>
<br>
but many more with the QVTKRenderWindow<br>
<br>
Mesa: User error: GL_INVALID_OPERATION in<br>
glDrawBuffer(buffer=0x405)<br>
Mesa: User error: GL_INVALID_OPERATION in<br>
glReadBuffer(buffer=0x405)<br>
...<br>
<br>
I am running Mesa 9.2.3 on my system (OpenSUSE 13.1), so I cannot<br>
switch to the OpenGL2 rendering backend (which might resolve the<br>
problem? - don't know...).<br>
<br>
Any hints?<br>
<br>
Thanks,<br>
<br>
sophonet<br>
<br>
Links:<br>
------<br></div></div>
[1] <a href="https://gist.github.com/samueljohn/3090097" rel="noreferrer" target="_blank">https://gist.github.com/samueljohn/3090097</a> [2] [2]<br>
<br>
Links:<br>
------<br>
[1]<br>
<a href="http://osdir.com/ml/python-enthought-devel/2008-04/msg00491.html" rel="noreferrer" target="_blank">http://osdir.com/ml/python-enthought-devel/2008-04/msg00491.html</a> [1]<br>
[2] <a href="https://gist.github.com/samueljohn/3090097" rel="noreferrer" target="_blank">https://gist.github.com/samueljohn/3090097</a> [2]<br>
</blockquote><span class="">
<br>
<br>
<br>
Links:<br>
------<br>
[1] <a href="http://osdir.com/ml/python-enthought-devel/2008-04/msg00491.html" rel="noreferrer" target="_blank">http://osdir.com/ml/python-enthought-devel/2008-04/msg00491.html</a><br>
[2] <a href="https://gist.github.com/samueljohn/3090097" rel="noreferrer" target="_blank">https://gist.github.com/samueljohn/3090097</a><br>
</span></blockquote>
</blockquote></div><br></div>