MantisBT - VTK
View Issue Details
0015433VTK(No Category)public2015-04-23 05:172015-05-07 15:13
ThomasKilgus 
David C. Lonie 
highminorhave not tried
closedfixed 
 
 
TBD
incorrect functionality
0015433: Anti-aliasing is disabled in VTK 6.2.0
We are using VTK for rendering in our software platform MITK (see mitk.org for more information). Since we switched to VTK 6.2.0 the anti-aliasing is disabled. We tested this on various OS such as: Mac OC, Ubuntu 14.04, Arch Linux and Windows 7. It is disabled everywhere.

To reproduce this is a VTK issue, I did the following but just on my Ubuntu 14.04 machine with a Geforce GTX 560 with both Qt5 and Qt4:
-Enabled wireframe property in the read STL example. See attached file.
-Clone VTK from github
-Checkout tag "v6.2.0"
-Build VTK and the example
-Run the example -> No anti-aliasing of the wireframe surface
-Checkout tag "v6.1.0"
-Build VTK and the example
-Run the example -> Anti-aliasing is enabled again

David Lonie reported on the mailing list that on the current dev branch everything runs fine. Was there any recent fix for this issue so we could patch our VTK?
No tags attached.
cxx ReadSTL.cxx (1,504) 2015-04-23 05:17
https://www.vtk.org/Bug/file/32/ReadSTL.cxx
png antialiasing.png (40,536) 2015-04-23 05:18
https://www.vtk.org/Bug/file/33/antialiasing.png
png

png AntiAliasingOff.png (1,898,018) 2015-04-23 08:33
https://www.vtk.org/Bug/file/34/AntiAliasingOff.png
Issue History
2015-04-23 05:17ThomasKilgusNew Issue
2015-04-23 05:17ThomasKilgusFile Added: ReadSTL.cxx
2015-04-23 05:18ThomasKilgusFile Added: antialiasing.png
2015-04-23 05:19ThomasKilgusNote Added: 0034368
2015-04-23 08:33ThomasKilgusFile Added: AntiAliasingOff.png
2015-04-23 09:11David C. LonieNote Added: 0034369
2015-04-23 09:50Christoph KolbNote Added: 0034370
2015-05-06 10:49David C. LonieAssigned To => David C. Lonie
2015-05-06 10:49David C. LonieStatusbacklog => active development
2015-05-06 11:37Joachim PouderouxNote Added: 0034396
2015-05-06 11:38Joachim PouderouxNote Edited: 0034396bug_revision_view_page.php?bugnote_id=34396#r1075
2015-05-06 14:12David C. LonieNote Added: 0034397
2015-05-06 14:40David C. LonieNote Added: 0034398
2015-05-06 14:48David C. LonieNote Added: 0034399
2015-05-06 15:37David C. LonieNote Added: 0034400
2015-05-07 07:18David C. LonieNote Added: 0034401
2015-05-07 07:18David C. LonieStatusactive development => gerrit review
2015-05-07 15:13David C. LonieNote Added: 0034402
2015-05-07 15:13David C. LonieStatusgerrit review => closed
2015-05-07 15:13David C. LonieResolutionopen => fixed

Notes
(0034368)
ThomasKilgus   
2015-04-23 05:19   
I also attached a screen shot to compare VTK 6.1 and VTK 6.2.
(0034369)
David C. Lonie   
2015-04-23 09:11   
Just to clarify, I had not tested this on master, I just mentioned that I'd used multisampling recently in a project and it seemed to be working onscreen, though offscreen rendering with OpenGL was broken.

I did just run your test case, and I can confirm that MSAA is not working correctly onscreen anymore with the current master branch.
(0034370)
Christoph Kolb   
2015-04-23 09:50   
This can also be observed in the RGrid example, assuming that the number of multisamples is 8 by default (which is not the case on mac)

Multisampling works after deleting the following two lines:

vtkOpenGL.h:22
#define GL_GLEXT_LEGACY

vtkXOpenGLRenderWindow.cxx:29
#define GLX_GLXEXT_LEGACY

I am sure that this is not a proper fix for that problem, but maybe it helps isolating it.

the second line was introduced in this commit:
http://www.vtk.org/gitweb?p=VTK.git;a=commit;h=800282f2 [^]
(0034396)
Joachim Pouderoux   
2015-05-06 11:37   
(edited on: 2015-05-06 11:38)
Just tested the provided example on Windows64, with VTK 6.3 (master) and the mesh is definitely anti-aliased here.

(0034397)
David C. Lonie   
2015-05-06 14:12   
Quick update:

I can confirm that the workaround fixes the multisampling, but only the GLX_GLXEXT_LEGACY in vtkXOpenGLRenderWindow.cxx needs to be removed.

This was added recently as newer OpenGL implementations provide a glxext.h header that uses the GLintptr and GLsizeiptr types, but does not define them.

I'm testing out a new workaround that replaces the

vtkXOpenGLRenderWindow.cxx:29
#define GLX_GLXEXT_LEGACY

with

#include "GL/glcorearb.h"

as that header defines these types.

This is consistent with Joachim's report on windows, as this should only affect systems using vtkXOpengLRenderWindow.

The gitlab branch for this issue is at: https://gitlab.kitware.com/vtk/vtk/merge_requests/178 [^]
(0034398)
David C. Lonie   
2015-05-06 14:40   
Ok, that didn't work. glcorearb isn't available everywhere.

I'll try just adding the typedefs to our version of glext.h...
(0034399)
David C. Lonie   
2015-05-06 14:48   
No go. It gets mangled into a namespace by the parsers and fails to compile with the missing typedef error.
(0034400)
David C. Lonie   
2015-05-06 15:37   
Tried updating the glext.h, glxext.h, and wglext.h files that ship with VTK, but there is a mess of colliding typedefs. It looks like a preprocessing issue.

Since the parsing/mangling of these headers will be going away soon, I'll try just defining the missing typedefs as needed rather than trying to fix up the parser that's going away soon. It works fine locally, testing on buildbot farm now.
(0034401)
David C. Lonie   
2015-05-07 07:18   
Patch up for review at https://gitlab.kitware.com/vtk/vtk/merge_requests/178. [^]
(0034402)
David C. Lonie   
2015-05-07 15:13   
Merged into master.