Questions tagged [vsync]

Vsync (short for Vertical Synchronization) is a rendering option for video cards. This option prevents the video card from changing the display memory until the monitor is done with its current refresh cycle.

Vsync (short for Vertical Synchronization) is a rendering option for video cards. This option prevents the video card from changing the display memory until the monitor is done with its current refresh cycle.

When vsync is applied, the rendering engine would match the maximum refresh rate of the monitor if the frame rate being produced is higher than the refresh rate of the monitor. This effectively throttles the maximum generated frames per second of the graphics card.

Turning vsync on can improve rendering quality when applied to applications that have frame rates significantly higher than the monitor's refresh rate as this relieves tearing of the image and results in smooth playback. On the other hand if the graphics card is outputting significantly lower frame rates than the monitor's refresh rate, this can result to the video output having judder as the graphics card may miss the monitor's refresh deadlines.

155 questions
4
votes
1 answer

Render canvas faster than 60 times per second?

My JS code: var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); var mouse = {x:0,y:0} const times = []; let fps; function refreshLoop() { window.requestAnimationFrame(() => { const now = performance.now(); while…
4
votes
2 answers

SDL/OpenGL game runs too fast on 144Hz screen; can't use vsync

This is how I handle the game loop: while (running) { diff = duration_cast(end - start).count(); start = clock::now(); dt = diff / (16.0); handleInput(); // get input update(dt); // game logic render(); //…
Accumulator
  • 873
  • 1
  • 13
  • 34
4
votes
2 answers

java - after GC application runs slow

I have an application (game) that runs on JVM. The game's update logic (which runs 60 times/s) finishes with about 25% used of it's "time-slice" (1/60s), then sleeps off the remaining 75%. But when the GC collector gets to run, it goes up to 75-200%…
Jake
  • 843
  • 1
  • 7
  • 18
4
votes
2 answers

Qt 5: disable vsync

I would like to disable vsync from the QOpenGLContext format in order to facilitate the integration of a third party rendering system. QSurfaceFormat::swapInterval seems to be the only related parameter in Qt. I tried several ways to implement this,…
FabienRohrer
  • 1,794
  • 2
  • 15
  • 26
4
votes
2 answers

Direct3D 12 windowed mode forces vsync

I am writing a simple Direct3D 12 application to prepare for the release of Vulkan, and it works as expected in all regards but one: running in a bordered window restricts the framerate to 60fps, even with vsync disabled. What puzzles me: the same…
Mako
  • 101
  • 1
  • 8
4
votes
2 answers

What hardware can support CADisplayLink class?

I'm making a game with iPhone. I found iPhone OS 3.1 supports v-sync with CADisplayLink class. I believe v-sync is ideal solution for game graphics, I'll use this only. (no fallback to NSTimer) But SDK doc says this too; CADisplayLink is supported…
eonil
  • 83,476
  • 81
  • 317
  • 516
4
votes
3 answers

How to enable VSYNC in OpenGL

The WGL_EXT_swap_control extension allows doing this on Windows, but I am unable to find anything even remotely cross-platform doing the same, i.e. syncing my buffer swaps with screen refresh. My application uses GLEW, so something offered by that…
Tronic
  • 10,250
  • 2
  • 41
  • 53
4
votes
1 answer

Using GdkFrameClock to synchronize a GtkDrawingArea with the screen refresh rate

Background I want to synchronize the updating of a widget to the screen refresh rate using GdkFrameClock. This is for visual stimulation response measurements off of an LCD screen (and therefore requiring as-close-to-exact frame synchronization as…
user
  • 4,920
  • 3
  • 25
  • 38
4
votes
2 answers

Smooth Drawing using Java2d without the Opengl or Direct3d Pipelines?

I can't figure out a way to get smooth movement or animation of anything using Java2d when the opengl and direct3d pipelines are disabled (by invoking the vm with -Dsun.java2d.d3d=false and -Dsun.java2d.opengl=false) The quick and dirty code below…
user1846344
4
votes
1 answer

Is a solid 60hz frame rate with OpenGL in fullscreen in OS X possible?

I am trying to write an application to display video in fullscreen that needs to be as smooth as possible. My OpenGL code is synchronised to the vertical refresh sync and most of the time the playback is smooth with low cpu usage. However,…
Eurico
  • 69
  • 3
3
votes
1 answer

Extracting frames from mp4in ffmpeg to jpg format produces error when using -vsync 0 option

I'm trying to extract all frames from a mp4 video with ffmpeg. I use the following command: ffmpeg -i "/Users/raimundbuehler/recordings/2022_01_24/000/exports/001/world.mp4" -vsync 0 "/Users/raimundbuehler/data/converted_frames/frame%06d.jpg" It…
RayBuehler
  • 31
  • 3
3
votes
1 answer

wpf wait for vsync (Image)

I use a UDP API that updates a camera feed to a ImageSource, I have a timer that updates the ViewModel's ImageSource and then WPF databinds the Image on screen. The timer has an interval that fires as many times as the refresh rate, but offourse…
Anders
  • 17,306
  • 10
  • 76
  • 144
3
votes
0 answers

What happens when AMediaCodec_releaseOutputBufferAtTime() [IN DETAIL]

When decoded output buffer is available and you want to render it onto the screen. With MediaCodec NDK APIs, you have an option to call AMediaCodec_releaseOutputBufferAtTime() if you have a native window registered already to render. My question is…
3
votes
1 answer

SDL_RenderPresent() not waiting for vsync - how to wait?

I initialize SDL with this code: SDL_Init(SDL_INIT_VIDEO); SDL_Window* win = SDL_CreateWindow( "SDL Window", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WIDTH, HEIGHT, SDL_WINDOW_SHOWN ); SDL_Renderer* ren =…
Accumulator
  • 873
  • 1
  • 13
  • 34
3
votes
0 answers

Screen tearing using OpenGL

I am encountering a screen tear issue using OpenGL on Windows 10. . I am doing a ray marching demo (rendering just 2 triangles and ray marching and shading terrain in fragment shader). Rendering with GTX 860M, the app does not have an issue with…
pseudomarvin
  • 1,477
  • 2
  • 17
  • 32
1 2
3
10 11