Wrong Rendered Frame Order - staggering animation


Im having problems with Unity rendering or displaying rendered frames in the wrong order.

The frames are rendered for example frame number 40,41,42,40,44. In this example, frame 43 is replaced with frame 40 for some reason. It happens randomly, not only or always at a specific frame number. It affects the renders only, the frame number is logged correctly. The result is that the animations stutter / jitter.

Why is this happening? Is it an editor only thing? Is it just my install or even a hardware problem on my computer?

To see if you have the same issue:
Add a UI Text, and add this javascript:

#pragma strict

var folder : String = "ScreenshotFolder";
private var TextComponent : UnityEngine.UI.Text;
private var i : int;
private var realFolder : String = "";

function Awake () {
	TextComponent = GetComponent(UnityEngine.UI.Text) as UnityEngine.UI.Text;
	i = 0;

function Start () {
	realFolder = folder;
	var count : int = 1;
	while (System.IO.Directory.Exists(realFolder)) {
		realFolder = folder + count;

function Update (){
	TextComponent.text = (i + "");
	var name : String = String.Format("{0}/{1:D04} shot.png", realFolder, Time.frameCount );
	Application.CaptureScreenshot (name);

Thanks I’ll try to see if it solves the problem

Yes It’s horribly confusing. Thats why I think it could be a problem related to my graphics card, hardware or install more than Unity itself. I had the problem in Unity 4, and also in unity 5 on the same computer, and noticed when I animated things with easing functions (Robert Penner’s I believe, but forgot where I found the original math) I converted to Unity. At times the animations became jittery / staggering.

I figured that it was some king of rounding problem, that numbers became corrupt with to many decimals. Or possibly v-sync. Or fixedupdate / update interference. But I realised this was not the case. I screen captured every frame writing the frame number into a UI text element, to observe the easing animation.

Now It became apparent that the logged frames sometimes displayed a frame 2 frames back, frame number 10 instead of 12, 19 instead of 21 but then continuing displaying the frames correctly. Sometimes these frames also had other quirks, one letter, usually the last on a row in the text displaying the character with the wrong / scrambled uv. But all other characters are rendered correctly.

At all times this behaviour happened I had text in the scene. Either 3d text in unity 4 or the new UI system in unity 5.

Its the whole frame that is wrongly displayed, not only one game object (s). Im on a 15 inch retina 2013 2,6 Ghz Intel Core i7, 16GB ram, Nvidia Geforce GT 750M 2048 MB

I did compile the project for iOs and did notice some staggering, but not really sure its the same issue as I can’t log the frames from iOs?

The sending of frames to the graphics card is synchronous also? The graphics card doesn’t cache frames? As some of the errors frames also displayed other text errors, maybe something is wrongly calculated and takes to much time to render or the same place in memory as the earlier frame? Ie it displays mostly the earlier frame buffer but the correct new inside some characters, making it appear that the uv is scrambled.

Very confusing…