I need to do an AR simulation. I need to clock the scene at about 270 fps, to calculate the IMU and gyro signals I am synthesizing. But I only want to RENDER at 60hz. I need the 270fps physics calculations for the sensors above, but I don't need to render that frequently. How could I approach this?
Try this. Set fixed timestep to 1/270: https://docs.unity3d.com/Manual/class-TimeManager.html Set Application.targetFrameRate to 60: https://docs.unity3d.com/ScriptReference/Application-targetFrameRate.html
Thanks! BUT - I need BOTH of them to be "fixed". I need the app to not run in real time, I need every frame rendered, no matter how long it takes. But I need the IMU timestemp to be 270HZ and the fixed render rate to be 60HZ. Can that be done?
Fixed timestep refers to Unity's FixedUpdate (Physics) timestep. Application.targetFrameRate applies to the Update timestep. https://learn.unity.com/tutorial/update-and-fixedupdate
I get it that fixed update is for physics and can be a higher frame rate, say 270. What I don't understand is that setting targetFrameRate will set the time between "Updates" to be a TARGET of the frame rate given, but they won't be exact. I need the time between Updates() to be exactly the same, and at a lower rate than FixedUpdate(). Can I do this?
I think what I needed to do is this: Time.fixedDeltaTime = 1.0f / ImuFrameRate; Time.captureDeltaTime = 1.0f / VideoFrameRate; this seems to work, and in non-realtime. It seems to be working nicely!