Smooth rendering?

Posts: 196
Joined: 2002.04
Post: #16
Quote:Originally posted by MattDiamond
Solutions might including capping the frame rate at some steady rate that each particular machine can manage, adjusting the physics with the frame rate so that objects seem to be moving at a constant speed, or performance analysis + tuning.

Iceman, can you put your finger on what specifically doesn't seem smooth about it?

My main program that I'm testing different solutions on is just a white square that I move around with the keyboard arrows. The problem is when I move the white square every inch or so on screen it seems to hiccup and tear. I'm running VBL syncing and the distance += (speed *time segment) for the physics. To cap the frame rate should I change the time interval in the timer? My monitor runs at 90 Hz but the FPS on the program runs at about 90 to 70 FPS.


Here's my small program source code:
Quote this message in a reply
Posts: 1,234
Joined: 2002.10
Post: #17
Two things to try:

1) make your timer slightly faster than your desired update rate. NSTimer is not very accurate. [Edit: default time of 0.005 should be fine.]

2) try a fullscreen GL context and see if it still happens. For me (and for the Apple VBL sample code), windowed contexts occasionally drop frames no matter what, because the app is fighting the entire OS for refresh time. Little things like the clock in the menubar are enough to make you drop a frame. Touch the dock or a menu, and forget about it. Fullscreen contexts, on the other hand, work very well.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Irrlicht Gouraud/Smooth Shading merrill541 4 9,681 Feb 3, 2010 01:13 PM
Last Post: merrill541
  Smooth model surfaces imikedaman 3 4,565 Jul 12, 2006 10:34 PM
Last Post: imikedaman
  2d smooth scroll Luzander 3 5,849 Jan 9, 2006 03:42 PM
Last Post: kelvin
  Smooth plane help Iceman 7 5,687 Jul 26, 2002 11:48 AM
Last Post: Iceman