Author Topic: OpenGL Performance Contd.  (Read 11898 times)

0 Members and 2 Guests are viewing this topic.

Mike Lobanovsky

  • Guest
OpenGL Performance Contd.
« on: April 27, 2014, 01:07:21 PM »
Hello community,

I would like to ask for your assistance. Attached below please find a "small" thinBasic program that's supposed to show if "image stutter" is seen on your computers when rendering moving 3D objects in OpenGL.


Terminology

1. By "image stutter" I mean very short momentary stop-overs of the 3D ball as it bounces horizontally in the window. There may be as few as just 1 or 2 such stopovers per the entire session; alternatively, heavy stuttering may be observed practically in every mode the program runs in. Once stopped for a fraction of a second, the balls "jumps" a little farther forward than it normally should or it may even bounce back a little if image stutter is heavy.

2. Similar to image stutter, another artifact may be observed especially if vertical synchronization is switched off:



This artifact is called "image tear" and it would affect a part of the ball that didn't have a chance to be drawn before the monitor started to draw another frame. This usually happens at very high FPS rates but it shouldn't happen with VSYNC set to 60 or 30 FPS. A visible difference between stutter and tear is that when the ball stutters, its entire image freezes momentarily while image tear would let the torn parts of the ball go on moving more or less smoothly.


Program Control

1. Those who have nVidia video cards and drivers, please open up your nVidia Control Center and make sure that your driver is controlled by this test application otherwise you won't be able to toggle its vertical synchronization settings:



A similar feature should be selected in ATi Catalyst Control Center if you happen to own an ATi Radeon video card.

2. The program starts with VSYNC set to none. The VSYNC settings are shown in the window title. You'll be able to toggle VSYNC between None, 60FPS and 30FPS by pressing 0, 1, and 2 number keys, respectively.


Objectives

The main objective is to test the program for image stutter in normal and maximized windowed modes under Classic, Basic, and Aero themes. If under XP only, Classic and any other theme should be tried.


Tactics

1. Set your desktop theme to Classic.

2. The program starts at the center of the screen. Here you probably won't see any stutter. Please drag the window to the top right then bottom left corner of the screen and let it stay there while you're watching the ball as it makes two or three successive bounces off the window borders. If the ball stutters at least once in any window position, image stuttering is considered to be present.

3. Press 1 to set VSYNC to 60FPS and repeat as described in Step 2.

4. Press 2 to set VSYNC to 30FPS and repeat as described in Step 2.

5. Maximize your window and see if image stutter occurs under VSYNC=None, then 60FPS, then 30FPS.

6. Set your desktop theme to Basic where available and repeat Steps 2 to 5. Set any theme other than Classic if you're under XP.

7. Set your desktop theme to any Aero theme and repeat Steps 2 to 5 (not applicable to XP).


Prognosis

Please inform us of your results in this thread. Most probably, ball movement will be:
-- absolutely smooth and stutter-less under Windows XP;
-- heavily stuttering in Classic and Basic themes but only occasionally stuttering in an Aero theme under Windows Vista; and
-- heavily stuttering in Classic, occasionally stuttering in Basic, and practically not stuttering in an Aero theme under Windows 7.

Reports for Windows 8 and 8.1 as well as other video cards would also be highly appreciated. Thanks a lot in advance.


Awaiting your soonest results,

P.S. Oh, and please have your browsers closed while running the tests. Modern browsers normally use OpenGL to render their content even if there are no pictures in view. Having OpenGL run several applications at once while benchmarking wouldn't seem very practical.

P.P.S. And oh one more time. If anybody wants the TB script I used, here it goes:

Code: [Select]
Uses "UI"
Uses "TBGL"

Function TBMain()
  Local hWnd As DWord
  Local x, k, diffx As Single
  Local dir As Long

  hWnd = TBGL_CreateWindowEx("-=:: Image Stutter Test ::=- VSYNC=None", 620, 500, 32, %TBGL_WS_CLOSEBOX Or %TBGL_WS_MINIMIZEBOX Or %TBGL_WS_MAXIMIZEBOX Or %TBGL_WS_DONTKEEPASPECTRATIO)

  TBGL_ShowWindow
  TBGL_ResetKeyState

  TBGL_UseLightSource %GL_LIGHT0, %TRUE
  TBGL_UseLighting %TRUE
 
  dir   = 1
  x     = 0
  diffx = .02
 
  TBGL_UseVSync 0

  While TBGL_IsWindow(hWnd)
    TBGL_ClearFrame

    TBGL_Camera 1.5,2,4,1.5,0,0
    TBGL_Color 0,200,200

    If x > 3 Then dir = -1
    If x < 0 Then dir =  1

    k = TBGL_GetFrameRate / 60
    x = x + diffx / k * dir

    TBGL_PushMatrix     
    TBGL_Translate x, 0, 0
    TBGL_Sphere 0.75
    TBGL_PopMatrix


    TBGL_DrawFrame

    If TBGL_GetWindowKeyState(hWnd, %VK_ESCAPE) Then Exit While
    If TBGL_GetAsyncKeyState(%VK_0) Then
      TBGL_UseVSync 0
      Win_SetTitle(hWnd, "-=:: Image Stutter Test ::=- VSYNC=None")
    ElseIf TBGL_GetAsyncKeyState(%VK_1) Then
      TBGL_UseVSync 1
      Win_SetTitle(hWnd, "-=:: Image Stutter Test ::=- VSYNC=60FPS")
    ElseIf TBGL_GetAsyncKeyState(%VK_2) Then
      TBGL_UseVSync 2
      Win_SetTitle(hWnd, "-=:: Image Stutter Test ::=- VSYNC=30FPS")
    End If
  Wend

  TBGL_DestroyWindow
End Function

.
« Last Edit: April 27, 2014, 01:55:36 PM by Mike Lobanovsky »

Petr Schreiber

  • Guest
Re: OpenGL Performance Contd.
« Reply #1 on: April 28, 2014, 09:03:56 AM »
Hi Mike,

thanks for bringing up this issue, not specific to OpenGL but "featured" in Direct3D too.
The VSync is a must for high quality renders.

On Windows 8, the stutter is not observable - testing configuration: Core i5 + GeForce GT640.

I am long time NVidia user (and programmer), and I do not remember having a big problems with stutter on PCs from win98 to 8. But I know SLI configurations suffered from it a lot.
I am living in PAL country, could it make a difference?

Only place where I see the micro stutter recently is in Unity engine, sometimes.

One of the approaches to watch effects of stutter would be to record video using camera pointed at PC screen, ideally at 60 FPS and short exposure time.


Petr

Mike Lobanovsky

  • Guest
Re: OpenGL Performance Contd.
« Reply #2 on: April 28, 2014, 07:06:52 PM »
Hello Petr,


Thanks a lot for your information...

On Windows 8, the stutter is not observable - testing configuration: Core i5 + GeForce GT640.
... and your report.

Quote
The VSync is a must for high quality renders.
A 60Hz VSYNC, either fixed or adaptive, yields the heaviest stutter on my hardware despite all the three monitors being set to a 60Hz refresh. No VSYNC and 30Hz give a much smoother picture.

Quote
I do not remember having a big problems with stutter on PCs from win98 to 8.
Neither did I until recently. XP is still perfectly stutter-less on my HW but it's not so any more under my Vista and 7, especially on non-composited Classic desktops.

Quote
But I know SLI configurations suffered from it a lot.
This is exactly why I asked for the community's assistance because I seem to be the only nVidia user armed with SLI on all the forums I'm registered at. My geForces are not top-notch any more but they cost me a fortune when I bought them five years ago and they didn't ever let me down in the meantime once I made it my habit to have my drivers upgraded regularly and automatically. I guess it will be a while more till I take a dicision to change them for anything else unless I'm directly forced to, e.g. by this unbearable stutter.

Quote
I am living in PAL country, could it make a difference?
So am I, that's why it couldn't. We did away with SECAM here about 20 years ago.

Quote
Only place where I see the micro stutter recently is in Unity engine, sometimes.
Yep, I'm observing it in Unity too but only if not masked off by motion blur.

Quote
One of the approaches to watch effects of stutter would be to record video using camera pointed at PC screen, ideally at 60 FPS and short exposure time.
I'm seeing this annoying stutter so vividly that I don't need any more video proof. It looks disgusting enough as it is. :)


Regards,
« Last Edit: April 28, 2014, 07:14:43 PM by Mike Lobanovsky »

Mike Lobanovsky

  • Guest
Re: OpenGL Performance Contd.
« Reply #3 on: April 28, 2014, 07:08:53 PM »
Hello Charles,

Can you confirm or deny image stutter (that's what we called "frame drop-outs" before) in this test application under your Vista?

JRS

  • Guest
Re: OpenGL Performance Contd.
« Reply #4 on: April 28, 2014, 07:26:17 PM »


Runs smooth with no ball shutter for me.

Wine 1.7.17 - Ubuntu 12.04 LTS 64 bit - IntelĀ® Ironlake Mobile

Mike Lobanovsky

  • Guest
Re: OpenGL Performance Contd.
« Reply #5 on: April 28, 2014, 08:50:27 PM »
Thanks for the feedback, John!

However I think the problem is strictly Windows-specific. Linux uses another OpenGL implementation that's called Mesa. Wine would use Mesa and its drivers to emulate Windows OpenGL behavior. The original Windows canvas is double-buffered in this sample but I think that if the desktop you're currently using is Unity, Compiz or Emerald, then your image may even get triple-buffered latently which usually yields much smoother movement.

All this makes your environment not particularly suitable for this test. I'm inclined to regard the stutter I'm seeing as either the incompatibility of my aging video cards with up-to-date nVidia drivers or the deficiency of these drivers on the current Windows platforms in general.

Of course, my SLI (that's nVidia's technique of using several video cards in parallel and it requires a special brand of motherboard) may also be the cause of the trouble as Petr rightfully pointed out. But if Charles confirms that this ball stutters (similar to what we saw in his ControlCraft.o2bas sample), this possibility will be ruled out because Charles has only one nVidia card installed IIRC.

JRS

  • Guest
Re: OpenGL Performance Contd.
« Reply #6 on: April 28, 2014, 08:57:09 PM »
I'm running GNOME Classic shell. (no Unity)

It seems Wine just keeps getting sweeter as it matures.  8)

Mike Lobanovsky

  • Guest
Re: OpenGL Performance Contd.
« Reply #7 on: April 28, 2014, 09:03:04 PM »
Sure it does. But you shouldn't forget that Wine's actual driving force are video games written for Windows. 8)

Seriously, Wine 1.7 is very good. Even on a Mac. :)

JRS

  • Guest
Re: OpenGL Performance Contd.
« Reply #8 on: April 28, 2014, 09:47:55 PM »
Quote
Sure it does. But you shouldn't forget that Wine's actual driving force are video games written for Windows.

The open source community is large and friendly and is home to many a forgotten friend. I use dosemu under Linux and it provides the best DOS experience I have had. I can't even run many of the DOS games on current Windows without using a DOSBox emulator. In my mind Linux has become an omni host to the lost, forgotten and those still with good sense.

Here is a good example of what I'm trying to say. I found a source version of William Yu's DOS emulation compiler. It was written C so I gave it a try with gcc (64 bit) and it compiled. It only generates DOS executables (that work) but still cool none the less.

Code: [Select]
jrs@laptop:~/.dosemu/drive_c/becdos$ ./bec EXAMPLE.BAS examu64.exe
BASIC Emulation Compiler v0.21 (c)1998-99 William Yu

Compiling: EXAMPLE.BAS to examu64.exe
Compiling using standard ANSI.LIB
Successful compile!
46 statements, 81 lines        Compile time: 0.000000
Variables: 4 strings, 3 integers
1503 bytes code, 0 bytes data
jrs@laptop:~/.dosemu/drive_c/becdos$ cat EXAMPLE.BAS
rem EXAMPLE.BAS by William Yu
rem   Demonstrates just some of the supported features of BASEC

DIM MyNAME    AS STRING * 30
DIM Message   AS STRING * 30
DIM CopyRIGHT AS STRING * 30
DIM PRODUCT   AS STRING * 15
DIM Year      AS INTEGER
DIM N AS INTEGER
DIM X AS INTEGER

MyNAME    = "William Yu"
PRODUCT   = "BASEC v0.20"
CopyRIGHT = "Copyright "
Message   = "Isn't that cool?!"

' BEC can handle almost any complex equation

N=10^3       '' Available operators (+-*/^=<>, MOD, AND, OR, XOR, NOT)
X=N/5 + 20
Year=(2 * N) / ((4 - -2) + -2) + (N - 100) / X + N + (N - (N / 2)) - 6

'CLS  ' This is a DOS function

? PRODUCT;" ";CopyRIGHT;Year;" by ";MyName
?
PRINT "My name is "; MyNAME:PRINT:PRINT "Count to ten: ";
FOR N=1 TO 10
  ?N;
NEXT N
?" how's that?":?"Notice that (unlike QB), the numbers aren't split up"
PRINT
PRINT "PRINT Message: "; Message
PRINT "Negative number: "; ---(10 MOD 6);" and ";
PRINT -10 + -val(mid$("100 or 200 or 300",8,3))
PRINT
PRINT "Other numbers ";  1456789; " and, "; 987654321;
PRINT 123456789
PRINT
PRINT "Hi, "; MyNAME; " how are you today?"
PRINT
PRINT "Let's try some bitwise operators..."

N = NOT 16
X = 32 OR 16 OR 8 OR 4 OR 2 OR 1
PRINT "NOT 16 = "; N; ",  32 OR 16 OR 8 OR 4 OR 2 OR 1 = "; X

N = 16 AND 16
X = 16 XOR 16
PRINT "16 AND 16 = "; N; ",  16 XOR 16 = "; X;
?

N = 16 XOR 255
PRINT "This is what N equals "; N
X = N = 2
PRINT "Does N equal 2? "; X
X = N > 2
PRINT "Is N greater than 2? "; X

IF N <> (255 XOR 16) THEN
  PRINT "N is "; N
  ?255 xor 16
ELSEIF N = 39 THEN
  ?"oh no"
ELSEIF N = 39 THEN
  ?"oh no"
ELSEIF N <> 239 THEN
  ?"oh yes"
  if X > 2 then
    ?"X is greater than 2"
  elseif X < 2 then
    ?"not!"
    ?X
  end if
else
  ?"howdy!"
END IF

PRINT "At the end\n\n\n"

END
jrs@laptop:~/.dosemu/drive_c/becdos$ dosemu

« Last Edit: April 28, 2014, 10:53:32 PM by John »

Mike Lobanovsky

  • Guest
Re: OpenGL Performance Contd.
« Reply #9 on: April 28, 2014, 10:57:33 PM »
I wasn't talking about DOS games. I was talking about contemporary 32-bit Windows games that currently are, and will continue to be, played by millions of people, such as World of Warcraft, Counterstrike, or the Sims, to name but a few. You can find fuller top charts at Wine Headquarters.

There's nothing to be ashamed of when talking about video games and their true impact on the computer industry. They have been one of its main driving forces alongside military warfare, avionics, or space exploration. A contemporary multi-monitor Itanium-based gaming station with liquid nitrogen cooling is really something worth seeing. :)

As for DOSbox, yes, it's one of the most often ported emulators in any new amateur or professional operating system. DOS games were generally as primitive as their host, that's why DOSbox as a program is by no means a complicated piece of software by contemporary standards. That doesn't mean that I don't like DOS games. Leisure Suit Larry 's adventures have always been among my favorites.

Quote
... friendly ...
No.
Quote
... the lost, forgotten and a few of those with good sense ...
Yes.

The Linux community is generally an irresposible, hostile and aggressive environment. My senses of perception, as well as my rationale, would classify the three major operating systems as being oriented towards i) Windows, men, ii) Mac OS X, women, and iii) Linux, their seed. :)
« Last Edit: April 28, 2014, 11:08:02 PM by Mike Lobanovsky »

JRS

  • Guest
Re: OpenGL Performance Contd.
« Reply #10 on: April 28, 2014, 11:04:53 PM »
I've only notice the BASIC community being a hostile bunch. Other open source projects seem to work together and not create a new version of the same thing just so they can say they could do it. Are we over 150 BASIC variations yet?

Mike Lobanovsky

  • Guest
Re: OpenGL Performance Contd.
« Reply #11 on: April 28, 2014, 11:18:14 PM »
Who told you a BASIC should be an open source project? How many BASIC's are there under Linux?

From my perspective, a coherent programming language is a filigree piece of intellectual craftsmanship where personal devotion and responsibility is of prime importance. Have you ever seen a coherent and responsible crowd?

Every worthwhile BASIC has a definitive authorship. It's another question that many of them went public domain or open source as soon as they were finalized. But they all do have a definitive person behind them but not a faceless crowd.

There was Linus Torvalds behind Linux. Who's behind it now that it's gone loose? Who should I sue if need be? "NO RESPONSIBILITY WHATSOEVER..." ... ;)
« Last Edit: April 28, 2014, 11:29:48 PM by Mike Lobanovsky »

JRS

  • Guest
Re: OpenGL Performance Contd.
« Reply #12 on: April 28, 2014, 11:24:04 PM »
Quote
How many BASIC's are there under Linux?

I only know of two that are worth using. Script BASIC & BaCon

Not much activity in the Windows commercial BASIC market from what I see.

Android seems to have picked up the slack.

Mike Lobanovsky

  • Guest
Re: OpenGL Performance Contd.
« Reply #13 on: April 28, 2014, 11:44:58 PM »
I only know of two that are worth using. Script BASIC & BaCon

Tell you what, John. That's because there is warm flesh and blood behind them rather than a list of faceless "contributors".

Quote
Not much activity in the Windows commercial BASIC market from what I see.

Do not forget about VB6 that's become de facto public domain and is still usable even on the latest Windows 8.1. There are still [o.k., edit] tens of thousands of programmers using it for both educational and business purposes.

Again, there's also VB.NET which is BASIC all right from VB6's standpoint. And VB.NET is almost as usable as C#.

The patient is more alive rather than dead.
« Last Edit: April 28, 2014, 11:53:54 PM by Mike Lobanovsky »

Charles Pegge

  • Guest
Re: OpenGL Performance Contd.
« Reply #14 on: April 29, 2014, 12:18:49 AM »
Hi Mike,

I get noticeable occasional stuttering of the ball animation in mode 1, (VSYNC 60 fps), otherwise smooth, though 30fps is not comfortable to watch at close range.

my Nvidia card is a GT120 (OEM card), and nearly 5 years old.
Intel Quad core 2.2GHz
OS: Vista Home Premium

I also notice occasional ticks and dropouts in audio, particularly when opening and closing various Windows. Is your system similarly affected?

Somnium
Robert Rich
http://www.youtube.com/watch?v=_SY94KemG0E

« Last Edit: April 29, 2014, 12:31:09 AM by Charles Pegge »