Pryme8 Posted November 9, 2017 Share Posted November 9, 2017 So, now I am getting to the point in my project where I need to ensure that the speeds of the animations are consistent per client and do not drastically change with fps changes. I was thinking of passing a uniform of a targetFPS, and a currentFPS. so lets say the target FPS is 60, and the current fps is 30 which means the animations should play at twice the "time" value in order to keep up with a client updating at 60 fps. So I guess something like: float rate = targetFPS/currentFPS; then when I do my time equation multiply the time by the rate? This is just theory and before I go about testing it I wanted to get others opinions on the idea. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted November 9, 2017 Share Posted November 9, 2017 Yes a uniform, but not 2. Would not just passing a timestamp, zeroed from when the mesh was created, be what you pass? Based on the value, be where you gotta be at that point in time. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted November 9, 2017 Author Share Posted November 9, 2017 Example please? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted November 9, 2017 Share Posted November 9, 2017 My only example currently working are the shader based "grand entrances" of teleport & poof. They done by the first 2 models here. The code is not obvious using shader builder, but in a beforerender, I am setting the uniform time. Since these shaders are are short lived, so they are getting a maximum of a value * percent complete, not actually the time. Does not make them a perfect example, but is close. No framerate is involved when determining percent, just timestamp subtraction. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.