Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


fps independance for complex calculations

This topic is 6403 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys! If you''ve read some of my earlier posts you might recall that I''m working on a demo that''s all about particle systems. Now, my problem is the fps independence. I know how to do it for simple things like linear movement but the calculations for these particles can become pretty involved and there are many factors that change and have an influence on teh particles movement. How do I make THAT fps independant? Do I just put the time factor in wherever I have absolute numerical values? Take for example this line of code, which is from the function that controlls particle behaviour: PHandle.Size = PHandle.Life / 10.0f; How would you make that fps independant? PHandle.Life changes each frame so there is already a time factor in that. Should I put a time factor in the 10.0f, too? Do it like this? PHandle.Life -= 0.02f * timefactor; PHandle.Size = PHandle.Life / (10.0f * timefactor); or like this? PHandle.Life -= 0.02f * timefactor; PHandle.Size = (PHandle.Life / 10.0f) * timefactor; Any advice? Please...? ----------------------------- "Mr Sandman bring me a dream"

Share this post

Link to post
Share on other sites
Yup. Just get the amount of time passed since the last frame, get that to where 1.0 is one second, and multiply your 10.0 by that.


DK Art (my site, which has little programming-related stuff on it, but you should go anyway^_^)

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!