[vtkusers] tutorial, step1, Cone runs like a snail on OSX 10.5

Francois Bertel francois.bertel at kitware.com
Thu Mar 12 19:50:00 EDT 2009


Hello,

If your display has a vertical refresh rate of 60Hz and the vertical
blank sync is set on your system,
each rendering of a frame waits for the next vertical blank to swap
the  front and back buffer.

360 frames/60Hz=6s.

I don't know how you can switch that off as a end-user on Mac.

But if you want to compare with GNU/Linux, I know how to switch it on
if you have an nVidia card:
1. launch nvidia-settings
2. go to X Screen 0->OpenGL Settings, check the box "Sync to VBlank"

or in a bash shell, type:
$ export __GL_SYNC_TO_VBLANK=1


Note you can also set this flag in your code. There are different ways
to program it:

* if your opengl implementation support it, you can use the
GLX_SGI_video_sync extension.

* it can also be a function specific to the system (cocoa,carbon), for
the Mac, it is a matter of setting the flag swapInterval to 1 or 0:

ref: http://developer.apple.com/documentation/graphicsimaging/Conceptual/OpenGL-MacProgGuide/opengl_contexts/opengl_contexts.html#//apple_ref/doc/uid/TP40001987-CH216-SW23

* On Windows, as a end-user, you can probably open the graphics driver
dialog box and find some checkbox. Or use the WGL_EXT_swap_control
extension in your code.

Regards.

On Thu, Mar 12, 2009 at 6:23 PM, Sean McBride <sean at rogue-research.com> wrote:
> On 3/12/09 3:12 PM, Darren Weber said:
>
>>On OSX 10.5  (see the project CMakeCache.txt attached):
>>
>>[ dweber at XXX ~/src/kitware/vtkTutorial/Step1/Cxx ]$ time ./Cone
>>
>>real   0m6.733s
>>user   0m0.233s
>>sys    0m0.186s
>
> Are you talking about the "Cone" example that shows a window with a
> cone, and the cone rotates 360 degrees?  If so, I get similar numbers on
> my system.  Do you see a visible difference in the cone's rotation speed
> between the two environments?  With this test, is the cone supposed to
> rotate at max possible speed?  I never thought so, but maybe it is....
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtkusers mailing list