Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


lipsryme

Member Since 02 Mar 2010
Offline Last Active Yesterday, 05:46 AM

Posts I've Made

In Topic: Difference between camera velocity & object velocity

09 June 2015 - 01:51 AM

Okay I think I get it now, it's just a performance optimization so that you don't always have to output velocity during your geometry pass. I got a little a confused with the concept when using temporal reprojection where you always need velocity and thought you always had to do it that way, however when thinking about it it's clear that you will still have the velocity needed for the temporal resolve if you use the other technique and then only render the object velocity when we need to.


In Topic: Need Help fixing my timestep

03 June 2015 - 06:25 AM

So basically you're interpolating between current and render state and not create a render state using prev and current ?


In Topic: Need Help fixing my timestep

01 June 2015 - 02:55 AM

@DaveSF yea I'm using a slerp for the orientation in the interpolation step

 

@Buckeye That's what I'm still trying to figure out, if this is conditional or not. As far as I can tell its not but I haven't had much time to test these last  few days...Basically I tried 3 test cases with 2 of them displaying the rendered velocity on screen:

 

1. Move the camera left and right (no rotation) while having a plane in front of you. My velocity that is calculated is constant (I double checked it). So the result should be a constant color during the movement, but it is not. You can see it flickering from time to time. (And no it's not an issue of the rendered velocity calculation because the stuttering can be observed regularly, too)

 

2. An object that I'm rotating around the Y axis using only "elapsedTime" which is accumulated inside the update loop using my deltaTime.

The output here should also be constant but it is not. Again the flickering can be observed

 

3. Standing in front of a plane that has a UV animation, where a symbol is "scrolling down". This time of course there's no velocity to be calculated but I believe the stutter can be observed here too...

 

What I believe right now is that the stuttering originates from the inner update while loop because the more intense the work inside becomes the bigger the stuttering/flickering becomes. E.g. I output the acc variable each update step to my GUI (which creates lag) and the flickering becomes very prominent...

 

UPDATE: I just tried removing the inner while entirely just to see how it behaved. If I don't limit my physics the motion is perfectly smooth. At least as long as the framerate is around the same as the update frequency.

As soon as I introduce a time difference variable (currTime - prevTime) as deltaTime, the stuttering reappears.

 

Don't think there's anything wrong with my method of getting the current time stamp but anyway here's the code:

const double GameTime::GetTime()
{
        if (start == 0)
	{
		QueryPerformanceCounter((LARGE_INTEGER*)&start);
		QueryPerformanceFrequency((LARGE_INTEGER*)&frequency);
		return 0.0;
	}

	__int64 counter = 0;
	QueryPerformanceCounter((LARGE_INTEGER*)&counter);
	return (double)((counter - start) / double(frequency));
}

In Topic: Need Help fixing my timestep

31 May 2015 - 09:14 AM

Ah, probably should have put it in regular text somewhere and not as a comment in the code.

gameTime->TimeStep is 1.0 / 60 as can be seen in my first post above:

while (accumulator >= gameTime->TimeStep) // gameTime->TimeStep is my dt, aka 1/60.0

By the way I was running all these tests in debug mode, not sure if that makes a difference ? I'm just using the fact that its slower to make the problem more apparent.

The log output in my last post was also with camera update only nothing else.

I'll post the output of it again with all other stuff enabled and also for the alpha...I just didn't want to clutter the post with endless line of log output happy.png

 

@Buckeye: I wasn't trying to dismiss anything I was just saying that  having perfectly smooth key or mouse input is not the issue here (and yes I've tested it with an object rotating where there was no input dependency) but still the same stuttering appears.

 

So here's on release build having everything active while moving the camera (render framerate was at ~8ms):

accumulator variable:

.00623527
0.0045869
0.00274861
0.00115632
0.00628035
0.00329853
0.000818271
0.00610214
0.0332849
0.0166182
0.0119594
0.000931529
0.00253443
0.000316677
0.00514446
0.0036926
0.00156247
0.00694533
0.00439248
0.00250909
0.00151845
0.00704723
0.00473195
0.00501755
0.0034216
0.0014187
0.00712786
0.00539406
0.00379078
0.00246577
0.000857353
0.00686019
0.00540869
0.00371375
0.00243347
0.000867589
0.000781058
0.00742953
1.2221e-007
0.00487447
0.00360886
0.00252399
0.00128257
4.62871e-005
0.00622694
0.00513584
0.00401834
0.00292321
0.0019432
0.00120004
0.000364846
0.00738618
0.00630608
0.00740084
0.00544706
0.00467016
0.00394239
0.00461735
0.00394678
0.00341332
0.00279005
0.00236475
0.00199628
0.00154422
0.00118565
0.000853107
0.000766209
0.000587654
0.00672394
0.00405963
0.00452708
0.00445595
0.00447537
0.00446144
0.0054495
0.00556352
0.00577432
0.00677668
0.00694423
0.0075169
0.000192347
0.000525974
0.0015727
0.00198259
0.00758396
0.00607857
0.00698598
0.00769173
4.23458e-005
0.00081593
0.00147219
0.00230407
0.00406793
0.0049603
0.00591023
0.00741414
0.000104258
0.00219735
0.00335149
0.00448584
0.00561689
0.00695655
0.0081041
0.000811812
0.00220757
0.00374631
0.00490889
0.00644323
0.00774917
0.000417281
0.00192046
0.0034339
0.0048183
0.00650772
0.00777406
0.000558763
0.00199925
0.00357795
3.66631e-007
0.00825065
0.000494939
0.000894927
0.00292605
0.0057755
0.00786346
0.0016454
0.00141844
0.00332565
0.0058268
0.00747846
0.000285899
0.00294653
0.00437822
0.00661686
0.00827439
0.00124791
0.00308435
0.00529476
0.00743368
0.000664206
0.00200827
0.00373766
0.00570646
0.000114236
0.00155692
0.00330794
0.00492991
0.00671906
0.00845212
0.00134058
0.00314659
0.00713333
0.00891735
0.00203715
0.00885794
0.00177647
0.00629152
0.0120285
0.00389374
0.00412948
0.00654043
0.000370034
0.0033588
0.00473073
0.00634243
0.00799409
0.0007447
0.00644763
0.00186768
0.0032374
0.00583937
0.00256756
0.00586869
0.00798708
0.000446947
0.00141008
0.00351307
0.00624079
0.00787156
0.000277533
0.00126046
0.00259316
0.00383676
0.00538651
0.00735934
0.0083837
0.00154823
0.00388
0.00643614
0.00734354
4.57555e-005
0.000952793

alpha variable:

0.640454
0.100803
0.657832
0.116773
0.758032
0.309936
0.873674
0.334375
0.919209
0.437126
0.958167
0.39962
0.984542
0.444319
0.00387785
0.483299
0.0793081
0.552306
0.0823874
0.532133
0.082629
0.565657
0.119563
0.608861
0.176009
0.649886
0.320249
0.794236
0.161423
0.652503
0.1964
0.638402
0.178581
0.63596
0.182826
0.646365
0.679493
0.534175
0.140853
0.616358
0.160299
0.666623
0.192283
0.643437
0.19941
0.680877
0.215644
0.693173
0.27935
0.731185
0.246045
0.712751
0.263731
0.781142
0.361863
0.835388
0.418133
0.911874
0.484632
0.0129758
0.557928
0.0129534
0.583709
0.0817403
0.673878
0.203454
0.763761
0.245535
0.898167
0.408429
0.429611
0.908108
0.499894
0.996891
0.596816
0.0590345
0.591118
0.0220118
0.617515
0.125401
0.733399
0.184553
0.721256
0.164953
0.854321
0.463881
0.158814
0.647804
0.267615
0.745166
0.358048
0.940661
0.476792
0.977155
0.51377
0.264996
0.159714
0.772618
0.372829
0.333804
0.997831
0.439723
0.965361
0.597997
0.336157
0.811706
0.463524
0.090682
0.674527
0.217433
0.904492
0.411366
0.0147884
0.528482
0.211317
0.819359
0.966568
0.487916
0.0927469
0.561631
0.154956
0.682531
0.230695
0.691989
0.3794
0.865904
0.419523
0.0810862
0.881763
0.489432
0.0967029
0.567829
0.161023
0.632217
0.256449
0.869309
0.41028
0.855912
0.46556
0.983939
0.21056
0.0628005
0.831141
0.328358
0.174593
0.759383
0.541208
0.272328
0.867282
0.500468
0.190276
0.742553
0.335791
0.861253
0.488786
0.0192855
0.642198
0.121817
0.69926
0.362979
0.106792
0.61503
0.183234
0.708344
0.343268
0.850736
0.620198
0.299689
0.0586147
0.829111
0.446986
0.991741
0.0658289
0.611089
0.201687
0.74499
0.320497
0.774752
0.502661
0.121482
0.750686
0.300324
0.92944
0.622746

In Topic: Need Help fixing my timestep

29 May 2015 - 05:41 AM

When outputting velocity to my backbuffer I can clearly see it flickering (ofc the stuttering movement can also be observed otherwise). Since the velocity is constant during my side movement (I checked it), the velocity should also be. I've been trying to find out which part is responsible for the issues but even after clearing out everything except camera update the irregular updates still occur.

I'm not quite sure how to profile this (don't really have any visualization code for a graph or something). What I can do is output something to my console or a text file. I'll try to do that to see if maybe it helps in any way.

 

@spiro I looked at the links you posted and it does make sense to buffer inputs however this isn't really an issue for me (at this point at least).

 

Update: What I can tell for sure is that the stuttering gets more apparent the slower my framerate is and it's there even if I remove any other updates besides the camera. I also tried after your suggesting checking if it's only the camera that's causing this issue and it does not seem to be the culprit.

Not exactly sure what to look for here or if this means anything to you but here's a snippet of what the output of the 'accumulator' variable was:

0.0166856
0.0232217
0.0292537
0.0194637
0.0259189
0.0329483
0.0236408
0.0310444
0.0212463
0.0285441
0.0187054
0.026145
0.033357
0.0166903
0.0260792
0.0172503
0.0248017
0.0328334
0.0235582
0.0310879
0.02137
0.0295939
0.020115
0.0278366
0.0182728
0.0274012
0.0177142
0.024856
0.0323144
0.0227163
0.0296397
0.020054
0.02779
0.0179823
0.0250991
0.0328471
0.0235878
0.0312245
0.0214731
0.0293287
0.0198176
0.0271874
0.0178227
0.0261996
0.016981
0.0244017
0.0327292
0.0234937
0.0314737
0.0220473
0.0291321
0.0195581
0.0270375

Update2: I did that output test again for a variable that just adds 0.01 inside the update loop and could see that during the output whenever there was a lag spike it would compensate for the pause with more updates so that in the end nothing was skipped 


PARTNERS