Jump to content

  • Log In with Google      Sign In   
  • Create Account

inconsistent frametime


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 champloo   Members   -  Reputation: 147

Like
0Likes
Like

Posted 08 June 2012 - 11:14 PM

Hello all,
I have a scene with nothing but 4 instances of a 26K vertices model. and there are two post passes. with one deferred shader and an anti-aliasing pass. the resolution is 1280x720. and my frame time follows this pattern:
0.006
0.005
0.005
0.006
0.005
0.012
0.001
0.005
...
This has been bothering me for a long time. Does anyone know why this happens?

Sponsor:

#2 L. Spiro   Crossbones+   -  Reputation: 14262

Like
0Likes
Like

Posted 08 June 2012 - 11:21 PM

You gave hardly enough information for anyone to make a guess.

I assume you are debugging with Microsoft® Visual Studio®, in which case this behavior is sometimes normal.
If you print things to the debug console you will get a little stutter, and even if you don’t you may get some stutter every second or so.
Run the application outside of the debugger and see if there is still stutter. If not, move on.

If there is, consider what else you could share for people to make a better guess.


L. Spiro

Edited by L. Spiro, 08 June 2012 - 11:24 PM.

It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums

#3 champloo   Members   -  Reputation: 147

Like
0Likes
Like

Posted 08 June 2012 - 11:38 PM

Thanks for that comment,
yes it's under Visual Studio 10 with DX11.
and it still stutters outside the debugger.
Even when there is no polygon on screen, or if I reduce number of the render targets I'm using, the frame time still stutters. but in a smaller range. like:
0.002
0.002
0.005
0.001
0.002
...
it's interesting that every longer frame is followed by a shorter frame. and they add up to the average frame time.

#4 champloo   Members   -  Reputation: 147

Like
0Likes
Like

Posted 08 June 2012 - 11:52 PM

update:
I'm debugging on my laptop. which has two graphics cards. and I was running the app on the nvidia card.
and I tried it on the Intel card, it runs without significant stuttering, although the frame time is longer. it's something like:
0.009
0.009
0.010
0.008
...

so is it safe to say it's the graphics card?

#5 L. Spiro   Crossbones+   -  Reputation: 14262

Like
0Likes
Like

Posted 09 June 2012 - 12:17 AM

Since you ran it outside the debugger and replied that it still stutters, my following question may seem silly, but I want it to be explicitly stated for the record: Can you actually visually see this stutter, or are you just trusting the numbers?

Also, you appear to be measuring time in milliseconds. What function(s) are you calling to measure time between frames?


L. Spiro

Edited by L. Spiro, 09 June 2012 - 12:18 AM.

It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums

#6 champloo   Members   -  Reputation: 147

Like
0Likes
Like

Posted 09 June 2012 - 12:49 AM

no I cannot feel the stutter when dragging the camera around.
I am calling timeGetTime() to get the value. and that's the value I'm using to update all my systems.

#7 Narf the Mouse   Members   -  Reputation: 318

Like
0Likes
Like

Posted 09 June 2012 - 01:06 AM

no I cannot feel the stutter when dragging the camera around.
I am calling timeGetTime() to get the value. and that's the value I'm using to update all my systems.

Ok, since you haven't posted the code:

1) Profile the code. Use code profiling software.
2) Run just a bluescreen. Run it through the code profiler.
3) If it's fluxuating about 1%, then call it good. Unbounded FPS fluxuates.

#8 L. Spiro   Crossbones+   -  Reputation: 14262

Like
0Likes
Like

Posted 09 June 2012 - 01:37 AM

I don’t think the above will be necessary.
There is no stutter. Stop using timeGetTime(). As you can clearly see by your timings, it is not accurate. It is not updated frequently enough to give you accurate timings.

You should be able to easily tell by how low your numbers are that milliseconds these days are no longer enough to keep track of time. Games these days need to be using QueryPerformanceCounter() and friend.

While QueryPerformanceCounter() itself may have its own problems on multi-core systems, in practice these problems never manifest and are largely only possible on a small set of hardware.
In either case, there is nothing better for Windows® in regards to game timing.


L. Spiro
It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS