-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed GFX running on wall time instead of sim. time #3170
Conversation
A few things are still running on wall time: Reflection+refraction water (didn't test reflection only and basic), HydraX caustics and wobbliness. Other than that (and, like in my attempt the sparks behaving weirdly) it's fine. |
@Miner34dev Thanks for the research, I've done a lot of water changes in #3142 so I'll fix these after it's merged. UPDATE: That PR ended up closed without merging, so I'll fix what I can here. |
I noticed beacons run when game is paused and also ignore simulation speed, always running at wall time. I remembered there are multiple other issues like this (props/water waves moving when paused) and I figured a way to tackle everything at once - I changed the time input for the entire scene update code (which is already consolidated into `GfxScene::UpdateScene()`) - instead of inputting wall time, I now input the adjusted simulation time, and I input zero if the game is paused or physics are globally paused. The particles had a custom code to correctly calc. sim. time and skip the update entirely when paused. I reverted all that, expecting the adjusted time input to fix particles, but that didn't work. I already researched this at RigsOfRods#3138 and figured to use `Ogre::ParticleSystem::setSpeedFactor()` - that did the trick.
Particles fixed: exhausts, cparticles, turboprops, turbojets, terrain object particles. Known issue: Particle time to live still runs on real time - this appears to be a bug in OGRE. Overview of changes: * Created helper `GfxScene::AdjustParticleSystemTimeFactor()`, applied to all particle systems in game. * Exhausts and CParticles moved from Actor (actor.h + simdata.h) to GfxActor (gfxactor.h + gfxdata.h). * Terrain object particle systems are now stored in vector<> in order to update their pace.
b6812a6
to
c72d1f4
Compare
I didn't think I can pull it off until OGRE upgrade, but I fixed HydraX caustics anim to run on simulation time instead of wall time. The only thing remaining is waves on classic water (simple/reflect/refract) - that's actually a physics (buoyance) logic, not just gfx, so it's not as easy to do, so I'll leave it out from this PR. |
While fixing #3169 I noticed beacons run when game is paused and also ignore simulation speed, always running at wall time. I remembered there are multiple other issues like this (props/water waves moving when paused) and I figured a way to tackle everything at once - I changed the time input for the entire scene update code (which is already consolidated into
GfxScene::UpdateScene()
) - instead of inputting wall time, I now input the adjusted simulation time, and I input zero if the game is paused or physics are globally paused.The particles had a custom code to correctly calc. sim. time and skip the update entirely when paused. I reverted all that, expecting the adjusted time input to fix particles, but that didn't work - they don't use that input. I already researched this at #3138 and figured to use
Ogre::ParticleSystem::setSpeedFactor()
- that did the trick.UPDATE: I synced all particles to simulation time: exhausts, cparticles, turboprops, turbojets, terrain object particles.
Known issue: Particle time to live still runs on real time - this appears to be a bug in OGRE.