title: Mayavi: Poor rendering (aliasing) under linux
body: <p>I wrote some mayavi code to visualise lines and images on Windows over the weekend. When I returned to my linux work-desk I was thoroughly disappointed running the same script. Execution time was a lot slower (it pas partly fixed by temporarily disabling the rendering in mayavi) and the output was aliased. I ran glmark2 to test my graphics card without problems.</p>
  <p>What can I do to get better rendering results in mayavi?</p>
  <h2>Mayavi output</h2>
  <p>Linux - aliased lines:</p>
  <p><img src="https://i.stack.imgur.com/L9dwU.png" alt="Low quality output from Mayavi under Linux" /></p>
  <p>Windows - lines are a bit smoother:</p>
  <p><img src="https://i.stack.imgur.com/K4dBZ.png" alt="Medium quality output from Mayavi under Windows" /></p>
  <h2>Glmark2 results</h2>
  <pre><code>=======================================================
      glmark2 2012.08
  =======================================================
      OpenGL Information
      GL_VENDOR:     Intel Open Source Technology Center
      GL_RENDERER:   Mesa DRI Intel(R) Ivybridge Desktop 
      GL_VERSION:    3.0 Mesa 10.0.0
  =======================================================
  [build] use-vbo=false: FPS: 2544 FrameTime: 0.393 ms
  [build] use-vbo=true: FPS: 2463 FrameTime: 0.406 ms
  [texture] texture-filter=nearest: FPS: 2775 FrameTime: 0.360 ms
  [texture] texture-filter=linear: FPS: 2267 FrameTime: 0.441 ms
  [texture] texture-filter=mipmap: FPS: 2179 FrameTime: 0.459 ms
  [shading] shading=gouraud: FPS: 1152 FrameTime: 0.868 ms
  [shading] shading=blinn-phong-inf: FPS: 1051 FrameTime: 0.951 ms
  [shading] shading=phong: FPS: 1068 FrameTime: 0.936 ms
  [bump] bump-render=high-poly: FPS: 520 FrameTime: 1.923 ms
  [bump] bump-render=normals: FPS: 2249 FrameTime: 0.445 ms
  [bump] bump-render=height: FPS: 1900 FrameTime: 0.526 ms
  [effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 1112 FrameTime: 0.899 ms
  [effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 466 FrameTime: 2.146 ms
  [pulsar] light=false:quads=5:texture=false: FPS: 1550 FrameTime: 0.645 ms
  [desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 394 FrameTime: 2.538 ms
  [desktop] effect=shadow:windows=4: FPS: 691 FrameTime: 1.447 ms
  [buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 530 FrameTime: 1.887 ms
  [buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 559 FrameTime: 1.789 ms
  [buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 558 FrameTime: 1.792 ms
  [ideas] speed=duration: FPS: 1108 FrameTime: 0.903 ms
  [jellyfish] &lt;default&gt;: FPS: 797 FrameTime: 1.255 ms
  [terrain] &lt;default&gt;: FPS: 101 FrameTime: 9.901 ms
  [conditionals] fragment-steps=0:vertex-steps=0: FPS: 1646 FrameTime: 0.608 ms
  [conditionals] fragment-steps=5:vertex-steps=0: FPS: 1796 FrameTime: 0.557 ms
  [conditionals] fragment-steps=0:vertex-steps=5: FPS: 1617 FrameTime: 0.618 ms
  [function] fragment-complexity=low:fragment-steps=5: FPS: 1644 FrameTime: 0.608 ms
  [function] fragment-complexity=medium:fragment-steps=5: FPS: 1796 FrameTime: 0.557 ms
  [loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 1695 FrameTime: 0.590 ms
  [loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 1709 FrameTime: 0.585 ms
  [loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 1697 FrameTime: 0.589 ms
  =======================================================
                                    glmark2 Score: 1387 
  =======================================================
  </code></pre>
  <h2>Update</h2>
  <p>I have updated my system with a Nvidia N450GTS graphics card and I am currently using the proprietary NVIDIA drivers (NVIDIA-Linux-x86_64-337.19.run). The output is still severely aliased and, as I later found out, contains incorrect z-order elements as seen in these images:</p>
  <p><img src="https://i.stack.imgur.com/1eJnn.png" alt="angle without z-order problems" />
  <img src="https://i.stack.imgur.com/BTXEw.png" alt="z-order problems" /></p>