<br>Right on, guys!<br><br>In lines 580 -- 606 of vtk 5.2.1 :: vtkCocoaRenderWindow.mm, we have<br><br><font size="1"><span style="font-family: courier new,monospace;">//----------------------------------------------------------------------------</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">void vtkCocoaRenderWindow::CreateGLContext()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">{</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">  NSOpenGLPixelFormatAttribute attribs[] =</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">      NSOpenGLPFAAccelerated,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">      NSOpenGLPFADepthSize,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">      (NSOpenGLPixelFormatAttribute)32,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">      (this-&gt;DoubleBuffer != 0) ?</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        (NSOpenGLPixelFormatAttribute)NSOpenGLPFADoubleBuffer :</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        (NSOpenGLPixelFormatAttribute)nil,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">      (NSOpenGLPixelFormatAttribute)nil</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    };</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  NSOpenGLPixelFormat* pixelFormat = [[[NSOpenGLPixelFormat alloc]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                                      initWithAttributes:attribs] autorelease];</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">  NSOpenGLContext* context = [[[NSOpenGLContext alloc]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                              initWithFormat:pixelFormat</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">                              shareContext:nil] autorelease];</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">  // This syncs the OpenGL context to the VBL to prevent tearing</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  //GLint one = 1;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">  GLint one = 0;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  [context setValues:&amp;one forParameter:NSOpenGLCPSwapInterval];</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  this-&gt;SetPixelFormat((void*)pixelFormat);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  this-&gt;SetContextId((void*)context);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">}</span></font><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><br>SO I switched to: <span style="font-family: courier new,monospace;">GLint one = 0;</span> and these are the results:<br>
<br><span style="font-family: courier new,monospace;">[ dweber@XXX ~/src/kitware/VTK_build ]$ time ./bin/Cone</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">real        0m0.432s</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">user        0m0.191s</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">sys        0m0.076s</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">[ dweber@XXX ~/src/kitware/VTK_build ]$ time ./bin/Cone</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">real        0m0.408s</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">user        0m0.191s</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">sys        0m0.077s</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">[ dweber@XXX ~/src/kitware/VTK_build ]$ time ./bin/Cone</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">real        0m0.405s</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">user        0m0.196s</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">sys        0m0.077s</span><br style="font-family: courier new,monospace;">
<br><br>Mucho gracias, amigos!<br><br><br>PS, Note the comment in the code about tearing, may be important for some apps to switch over to sync mode.<br><br><br><br>On Thu, Mar 12, 2009 at 5:02 PM, Sean McBride &lt;<a href="mailto:sean@rogue-research.com">sean@rogue-research.com</a>&gt; wrote:<br>
&gt; On 3/12/09 7:50 PM, Francois Bertel said:<br>&gt;<br>&gt;&gt;Hello,<br>&gt;&gt;<br>&gt;&gt;If your display has a vertical refresh rate of 60Hz and the vertical<br>&gt;&gt;blank sync is set on your system,<br>&gt;&gt;each rendering of a frame waits for the next vertical blank to swap<br>
&gt;&gt;the  front and back buffer.<br>&gt;&gt;<br>&gt;&gt;360 frames/60Hz=6s.<br>&gt;&gt;<br>&gt;&gt;I don&#39;t know how you can switch that off as a end-user on Mac.<br>&gt;<br>&gt; François,<br>&gt;<br>&gt; Good thinking.  VBL sync is always on in vtkCocoaRenderWindow.  This is<br>
&gt; the responsible snippit:<br>&gt;<br>&gt;  [context setValues:&amp;one forParameter:NSOpenGLCPSwapInterval];<br>&gt;<br>&gt; Darren, try commenting that line out and rebuilding VTK.  See if<br>&gt; François&#39; theory is correct.<br>
&gt;<br>&gt; --<br>&gt; ____________________________________________________________<br>&gt; Sean McBride, B. Eng                 <a href="mailto:sean@rogue-research.com">sean@rogue-research.com</a><br>&gt; Rogue Research                        <a href="http://www.rogue-research.com">www.rogue-research.com</a><br>
&gt; Mac Software Developer              Montréal, Québec, Canada<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; Powered by <a href="http://www.kitware.com">www.kitware.com</a><br>&gt;<br>
&gt; Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>&gt;<br>&gt; Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>&gt; Follow this link to subscribe/unsubscribe:<br>&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>&gt;<br><br>