[vtk-developers] Drawing performance problems with Cocoa; what is Render() exactly?

Berk Geveci berk.geveci at kitware.com
Thu Feb 1 14:42:42 EST 2007


Hi Sean,

It does a few things, too many to remember :-) Look at the following methods:
vtkRenderer::Render()
vtkOpenRenderer::DeviceRender()

Beside all of the usual OpenGL render calls (which should be
relatively fast with display lists on), some information is sent up
the pipeline and is requested back. This should be very fast as long
as the number of actors in the renderer is relatively small (let's say
< 100).

I believe there is a backing store option in the renderer. You might
want to investigate that. I am curious to know what you find, please
keep me posted.

-berk

On 2/1/07, Sean McBride <sean at rogue-research.com> wrote:
> Hi all,
>
> We have discovered a performance problem and are looking for some help/advice.
>
> (First a short explanation of the Cocoa graphics model.  There are 2
> important classes: NSWindow and NSView.  A 'window' is not the same as
> in MS-Windows.  A 'window' refers to what an end user would call a
> window.  Views are not subclasses of windows.  An NSView lives in an
> NSWindow, and occupies a rectangular area.  An NSView does all its
> drawing from its drawRect: method.  drawRect: is never invoked directly,
> but rather the OS decides when a view needs to draw itself by sending it
> the drawRect: message, at which point a view _must_ draw itself.  If you
> want your view to redraw, you mark it dirty my calling [myView
> setNeedsDisplay:YES] and sometime later the OS will send the view a
> drawRect: message.  One has no control over when the OS will require
> one's view to draw, so drawRect: must be fast, and do the minimum needed
> to get the pixels onscreen.)
>
> In vtk there is an NSView subclass named vtkCocoaGLView.  Its drawRect:
> method invokes vtkRenderWindow's Render() method.
>
> So the questions are: what exactly does Render() do?  We know it draws
> (via OpenGL), but does it also do other computations?  Is Render()
> overkill when all we need is to draw?
>
> The problem is that the OS often sends vtkCocoaGLView a drawRect:
> message even though nothing (camera, scene, lights, etc.) has changed
> since the last drawRect: message.  Since we have no control over when
> the OS sends drawRect: we are looking to make it faster.
>
> Thanks!
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
>
>
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers
>


-- 
 Berk Geveci
 Kitware Inc.
 28 Corporate Drive
 Clifton Park, NY, 12065



More information about the vtk-developers mailing list