Re: Uneven V-sync
"Edition Chamäleon" <[email protected]> Sat, 21 Jan 2017 20:44:22 +0000
| Newsgroups | gmane.comp.lib.sdl |
|---|---|
| Message-ID | <[email protected]> |
Hi together, and thank you very much for your thoughts and hints. I appreciate very much. @Eric: > I'm not sure what's going on in your case, but I think you should also try measuring the time between the start of each loop. I would not be looking for an exact 16 ms, but I would be looking for numbers less than that." In my case the gameloop runs fluidly most of the time, but it stucks one to two times per second, so that the scrolling jerks. Meaning the gameloop with all grafic rendering can be done in 16ms most of the iterations. But only on Android. For me an indication, that my gameloop is not to long in principle. It seemed to me, that something from extern or SDL timer disturbs my game. That SDL runns on a backgroundthread fits here. To investigate this guess more closely I made this minimal programm above with almost no calculations in gameloop, which shows uneven iteration times. And very big deviation ( e.g. 45ms ) one or two times a second either. > "Try using smaller textures. If you have too high a texture resolution, you might be getting killed in fill rate. This is not realy an option. The problem with the uneven v-sync accures even when rendering only a single texture with only very low resolution. Rendering even less than that means rendering nothing. The SDL_THREAD_PRIORITY option had no impact in my case, so I removed it. SDL_RENDER_ACCELERATED is true on default, SDL_WINDOW_BORDERLESS and SDL_WINDOW_OPENGL is on in my case. I will look into SDL_PerformanceCounter and SDL_PollEvent, didn't know about this features till now. @Rainer Deyke > If the game renders slower than the display refresh rate, then the time > per frame will always be uneven. > Waiting saves battery time I don't think, my gameloop takes more than 16ms for calculations and rendering, because most of the iterations are done fluidly in 16ms and the work per itartion is always the same. But one to two times per second the scrolling jerks an I measure fps from up to 45ms. But only for one or two iterations. It doesn't look like a battery save action to me, more a disturbance from extern or a timer problem. To underpin my guess I measured the minimal programm above. It shows the same problem, even with already no calculation and minimal rendering. I thank you all for your time and your ideas. Please tell me more, because I am not yet on homebase. :) _______________________________________________ SDL mailing list [email protected] http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org