no vsync means double buffering to avoid tearing, right?

Started by
17 comments, last by Norman Barrows 9 years, 2 months ago

no vsync means double buffering to avoid tearing, right?

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

Advertisement

Without vsync there will be tearing, whether double or triple buffering doesn't matter.

Tearing occurs whenever the drawing of the image crosses the point where the monitor refreshes its image.

Therefore unless you use vsync to time the correct point to update the image, you will risk tearing. There is a chance that your update will be fast enough that no tearing will occur 99.9% of the time, but someone will notice it, eventually.

single buffering = not possible on modern OS's

double buffering = mandatory! Screen tearing will be visible.

double buffering w/ vsync = no tearing, but CPU/GPU sleeps occur (waiting for vblank) if frame-time doesn't line up with refresh rate nicely

triple buffering = greater latency...

triple buffering w/ vsync = no tearing, greater latency, but less CPU sleeps.

single buffering = not possible on modern OS's

Sometimes I wish it was possible only to create less laggy GUIs...

single buffering = not possible on modern OS's

Sometimes I wish it was possible only to create less laggy GUIs...

Single buffering w/out VSync is the best way to reduce latency, but it will be glitchy as hell.

Double Buffer w/ VSync often achieves lower latency than Single Buffering w/ VSync.

single buffering = not possible on modern OS's


Sometimes I wish it was possible only to create less laggy GUIs...

Maybe these could help you (on Direct3D) if you render the GUIs separeted from the rest:

https://msdn.microsoft.com/en-us/library/ff471334.aspx
https://msdn.microsoft.com/en-us/library/dn448914.aspx (unfortunately DXGI 1.3 and greater only)
"Recursion is the first step towards madness." - "Skegg?ld, Skálm?ld, Skildir ro Klofnir!"
Direct3D 12 quick reference: https://github.com/alessiot89/D3D12QuickRef/

I suppose that most future monitors and graphic cards will support freesync or gsync. Which will make this issue probably go away in about 5-7 years.


Tearing occurs whenever the drawing of the image crosses the point where the monitor refreshes its image.

yeah, that makes sense. been a long time since i wrote directly to vidram... what was it 0x0A000:0000 or something like that? just looked it up. 0xA0000 was dos vidram address. set a pointer and let's party on the bitmap! <g>.


single buffering = not possible on modern OS's
double buffering = mandatory! Screen tearing will be visible.
double buffering w/ vsync = no tearing, but CPU/GPU sleeps occur (waiting for vblank) if frame-time doesn't line up with refresh rate nicely
triple buffering = greater latency...
triple buffering w/ vsync = no tearing, greater latency, but less CPU sleeps.

so double buffer with vsync is the best i can get with no tearing and low latency eh? thanks for the tip. seems some things never change. i remember implementing a double buffer system for the game library - might have been back in my pascal days (late 80's). It did sprites and lines and rectangles and such. The C++ version of that module was actually used in Caveman 1,.0 in 2000 to do 2D sprites by adding a "color keyed alpha test blit to d3d backbuffer" method to the double buffer module. Caveman 2.0 (circa 2008) and Caveman 3.0 use d3dx sprites and/or d3dx fonts.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

Personally I'd use triple buffering w/vsync. Ofcourse it depends on a lot of factors, in my case I had unneccesary long frame times without triple buffering.

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

This topic is closed to new replies.

Advertisement