no vsync means double buffering to avoid tearing, right?
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.
Maybe these could help you (on Direct3D) if you render the GUIs separeted from the rest:single buffering = not possible on modern OS's
Sometimes I wish it was possible only to create less laggy GUIs...
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.