Forum Discussion
ScottieBizzle
10 years agoExplorer
Turning off VSync with 0.8 SDK
My engine runs its rendering and simulation passes at different frequencies since some simulations require running 150+ iterations per second, yet the rendering only needs say 60 frames per second.
When I enable the Oculus, the VSync limits my rendering to 75 f/s, but since my simulation is running in the same thread, my simulation speed is also limited to 75 f/s which my animation throttling system assumes it can't keep up and reduces the overall animation speed to 2x slow motion ( since 75f/s is half of the required 150f/s the simulation is asking for ).
So, besides having to multi-thread my engine, is there any way to turn off VSync anymore in the 0.8 SDK? It no longer has the ovrHmdCap_NoVSync flag for the ovr_SetEnableCaps function.
Thanks!
When I enable the Oculus, the VSync limits my rendering to 75 f/s, but since my simulation is running in the same thread, my simulation speed is also limited to 75 f/s which my animation throttling system assumes it can't keep up and reduces the overall animation speed to 2x slow motion ( since 75f/s is half of the required 150f/s the simulation is asking for ).
So, besides having to multi-thread my engine, is there any way to turn off VSync anymore in the 0.8 SDK? It no longer has the ovrHmdCap_NoVSync flag for the ovr_SetEnableCaps function.
Thanks!
5 Replies
- cyberealityGrand ChampionI don't think there is an option to disable V-Sync any longer.
But does your simulation really need to run at 150fps? Can you make it framerate independent? - owenwpExpert ProtegeYou could just skip all rendering every other frame, or X number of fixed time simulation steps per render loop to match a desired number of steps per second. Having your simulation timestep be framerate dependent is never a good idea unless you really dont care about stability. People with slower computers will see different behavior, or behavior will change depending on what is visible on screen.
- ScottieBizzleExplorer
"cybereality" wrote:
I don't think there is an option to disable V-Sync any longer.
But does your simulation really need to run at 150fps? Can you make it framerate independent?
Yes unfortunately for many simualtions like smooth particle hydrodynamics, fluid dynamics or fur for example you need a pretty small time step so the simulation doesn't blow up, and ideally the time step should not fluctuate or at least have a minimal ( stable ) rate. I'm guessing turning of V-Sync isn't the ideal solution anyway so I'll try to find a work around like running the simulation multiple times per frame as owenwp suggested, I just think this will result in hitching if I want or need a simulation rate that is not a perfect multiple of 75hz. For 150 I'd just run the simulation twice per rendered frame, but if I wanted 120, I'd have to double up simulation steps every 5 of 8 frames which I can see causing a problem since the steps need to be the same length.
Same problem I'm guessing will happen if I multi-threaded. - ScottieBizzleExplorer
"owenwp" wrote:
You could just skip all rendering every other frame, or X number of fixed time simulation steps per render loop to match a desired number of steps per second. Having your simulation timestep be framerate dependent is never a good idea unless you really dont care about stability. People with slower computers will see different behavior, or behavior will change depending on what is visible on screen.
Thanks, I'm going to try this when I have some time. As mentioned above it might have to be a perfect multiple, like doubling up simulation steps per frame to achieve 150 or else I'd be doing 2 simulation steps one frame, and maybe not the next, but my simulation steps need to be the same length for consistent simulation.
Would be better if the VSync didn't stall the engine or thread, but I guess that's how it's designed to work and I probably need some tricky multi-threading support. - cyberealityGrand ChampionI don't think there should be any issue with iterating multiple times per frame with a fixed timestep. This is ideal, since you should not rely on the framerate being anything is particular (as this can be variable based on so many factors). See this article. http://gafferongames.com/game-physics/f ... -timestep/
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 3 months ago
- 1 month ago