Jump to content

Syncing Shader Speed Per Different Client Update Rates


Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...