Question about SwapBuffer

Question about SwapBuffer

Post by Enrico Di Bernard » Wed, 24 Sep 1997 04:00:00



I'm using OpenGl to render in real-time a wire-framed body animation
under WindowsNT. If I profile the function that does the drawing I  find
that it spends  2 msec/frame to do all the drawing and 25 msec/frame
inside the SwapBuffer() wgl call.
Is it normal that SwapBuffer take so long to execute or I'm doing something
wrong ?
Is there any way I could go below 10 msec/frame total ?
I should say that I don't use any special hardware and I'm running on a
PentiumPro 200.

Below it's the setting I'm using for the pixelformat:

pdf = {
sizeof(...),
1,
PDF_DRAW_TO_WINDOW |
PDF_SUPPORT_OPENGL |
PDF_DOUBLEBUFFER,
PDF_TYPE_RGBA,
24,
0,0,0,0,0,0,
0,
0,
0,
0,
0, 0, 0, 0,
32,
0,
0,
PDF_MAIN_PLANE,
0,
0,0,0,};  

Thanks for your attention,

-----------------*************--------------**************-----------------
  Enrico Di Bernardo, PhD
  Vision Lab, 136-93
  Division of Engineering and Applied Science
  California Institute of Technology
  Pasadena, CA 91125

  Phone: +1 626 395-4859 (Office)
         +1 626 799-3482 (Home)
  Fax:   +1 626 795-8649
*****************------------***************--------------******************

 
 
 

Question about SwapBuffer

Post by tong xi » Thu, 25 Sep 1997 04:00:00



> I'm using OpenGl to render in real-time a wire-framed body animation
> under WindowsNT. If I profile the function that does the drawing I  find
> that it spends  2 msec/frame to do all the drawing and 25 msec/frame
> inside the SwapBuffer() wgl call.
> Is it normal that SwapBuffer take so long to execute or I'm doing something
> wrong ?
> Is there any way I could go below 10 msec/frame total ?
> I should say that I don't use any special hardware and I'm running on a
> PentiumPro 200.

> Below it's the setting I'm using for the pixelformat:

> pdf = {
> sizeof(...),
> 1,
> PDF_DRAW_TO_WINDOW |
> PDF_SUPPORT_OPENGL |
> PDF_DOUBLEBUFFER,
> PDF_TYPE_RGBA,
> 24,
> 0,0,0,0,0,0,
> 0,
> 0,
> 0,
> 0,
> 0, 0, 0, 0,
> 32,
> 0,
> 0,
> PDF_MAIN_PLANE,
> 0,
> 0,0,0,};

> Thanks for your attention,

> -----------------*************--------------**************-----------------
>   Enrico Di Bernardo, PhD
>   Vision Lab, 136-93
>   Division of Engineering and Applied Science
>   California Institute of Technology
>   Pasadena, CA 91125

>   Phone: +1 626 395-4859 (Office)
>          +1 626 799-3482 (Home)
>   Fax:   +1 626 795-8649
> *****************------------***************--------------******************

Hi,
        Please try to use single buffer mode to test your program.
        If it is still slow, then you can try anyway to speed up it.
        For double buffer mode, the frame rate is no larger than the    vertical
refresh rate of your display. Even if you spend 2ms to
        draw a scene, on the display that has 60hz refresh rate, the scene
display rate will be at most 60 frame rate in double buffer mode.

 
 
 

Question about SwapBuffer

Post by Zachary Hilbu » Thu, 25 Sep 1997 04:00:00




> > I'm using OpenGl to render in real-time a wire-framed body animation
> > under WindowsNT. If I profile the function that does the drawing I
> find
> > that it spends  2 msec/frame to do all the drawing and 25 msec/frame
> > inside the SwapBuffer() wgl call.
> > Is it normal that SwapBuffer take so long to execute or I'm doing
> something
> > wrong ?
> > Is there any way I could go below 10 msec/frame total ?
> > I should say that I don't use any special hardware and I'm running

*****************------------***************--------------******************

Quote:> Hi,
>         Please try to use single buffer mode to test your program.
>         If it is still slow, then you can try anyway to speed up it.
>         For double buffer mode, the frame rate is no larger than the
> vertical
> refresh rate of your display. Even if you spend 2ms to
>         draw a scene, on the display that has 60hz refresh rate, the
> scene
> display rate will be at most 60 frame rate in double buffer mode.

I think that when using Windows NT, SwapBuffer will only be synced to
the frame rate if you are using an OpenGL accelerator card.  If you are
using software only, SwapBuffer is independent of the refresh rate.
Your processing time is probably being spent in copying the entire
screen accross the PCI bus to your video card.  If you use
glAddSwapHintRectWIN, you can reduce the portion of the screen which is
being copied.  If this is not fast enough for you, you will need to get
an OpenGL accelerator card which has the screen buffer onboard and thus
bypasses the PCI bus.

--

Software Consultant                     www.vianova.com/vianova
Via Nova                                OpenGL, Open Inventor products for Windows 95/NT
Dallas, Texas

 
 
 

1. Performer callback before swapbuffer?


There is a routine to do exactly this, pfPipeSwapFunc.

     Normally a pfPipe swaps the color buffers at the end of each
     frame.  However, if special control is needed over buffer
     swapping, pfPipeSwapFunc will register func as the buffer
     swapping function for pipe.  Instead of swapping buffers, func
     will be called and will be expected to swap the color buffers of
     the provided pfPipeWindow.  pfGetPipeSwapFunc returns the buffer
     swapping function of pipe or NULL if none is set.

Allan
--

Silicon Graphics                               http://reality.sgi.com/allan

2. Newbie

3. Off Broadway Newsletter - Winter? 97

4. timing of swapbuffers (), help please...

5. Similar colors

6. swapbuffer timeout on RealityEngine

7. Leadtek Video cards, esp. L2300 ??

8. system swapbuffer call?

9. swapbuffers() timing

10. Sirius video and swapbuffer timeout

11. Q: no swapbuffers in SoXtRenderArea

12. Onyx RE2: swapbuffer timeout **freeze the screen**