#Separate System for VSync

1 messages · Page 1 of 1 (latest)

orchid kraken
#

Are there ways to have a specific system be VSynced? Setting QualitySettings.VSync forces the entire simulation system group to be vsynced together with all system groups beneath it, but given how flexible the system groups are it could be nice to have stuff that affects rendering separate from systems that read input or variable rate stuff.

bronze lance
orchid kraken
bronze lance
orchid kraken
#

Essentially, one might want:

  • FixedUpdate: Game Logic calculations that work best when calculated at a fixed rate
  • RenderUpdate: Any calculations only tied to rendering that shouldn't be done more often than the screen can refresh
  • InputUpdate: If somebody moves the mouse and clicks three times while moving it within 1 frame, then each position clicked at matters, even if the rendering doesn't update between every clicked position
bronze lance
#

I still don't know what you want.
If you enable QualitySettings.VSync, and have VSYNC set on 60 FPS, your game and every system runs on 60 FPS or less, if your game is too slow to get to 60 FPS.
If you have 30 FPS, your FixedUpdate will run twice each frame, but your RenderUpdate and InputUpdate only run once each frame.
But it seems like you don't want to VSYNC, but read the monitor's refresh rate, and only do RenderUpdate on that refresh rate? Is that correct?
If so, why is VariableRateSimulationSystemGroup not the solution if you set that to 60, or w/e your monitors refresh rate is?

deft barn
orchid kraken
deft barn
#

and get their beloved 250fps

#

people with 250fps are probably having freesync monitors anyway

#

so vsync must be turned off

orchid kraken
deft barn
#

just add your rate manager

#

which detects when a frame should be ready

#

and see how it works for you

orchid kraken
orchid kraken
#

Hmm, yeah, it doesn't work, all internal rendering stuff still happens separate from that on every unity frame

#

So for gpu instancing for example you'd see flickering

deft barn
#

so what you might want is to just run simulation at 250 fps

#

while leaving actualy fps to whatever value vsync works at

#

probably going to be confusing compared to other apps

#

but with those new frame generations, it's getting common I guess

orchid kraken
#

Tbh, for the current project it's probably not going to be worth it, but for something like a rhythm game it might be a lot more vital

deft barn
#

there isn't much to it actually

orchid kraken
#

Though I just found OnDemandRendering, so that might be exactly what I'm looking for

deft barn
#

implementation of what you want is very modular

#

and most likely will end up in less then 300 lines solution

earnest stream