Jump to content
tumira

Frame limiting or frame smoothing

Recommended Posts

I would like to request frame limiting or frame smoothing built into the engine. Currently I and others encounter these strange bug , stuttering or jerkiness when rotating or when looking at certain angle with flash light

 

http://www.leadwerks.com/werkspace/topic/9182-frame-drops-when-rotating-camera/page__st__20

 

and this

 

http://www.leadwerks.com/werkspace/topic/15387-leadwerks-42-rc4-flashlight-causes-alot-of-performance-hit/

 

 

Frame limiting based on user monitor refresh rate or even let user define their own preference would be a cool features to make leadwerks game smooth and not jerky or stutter.

 

My current solution is to install MSI afterburner and set the frame limit manually to 60 (based on my monitor refresh rate) would be great if this is built into the engine especially when vsync is on.

Share this post


Link to post

I mean, force the game to run in a arbitrary frame-rate, like force a game run on 30FPS (not every genre need to be 60FPS). Vsync ("context:Sync(true)") will try to match the refresh rate of the monitor.

Share this post


Link to post

Yeah. Do a little digging and found out about Time:Step() . If i added this before Time:Update() , the stuttering is mostly gone. It is now smooth when rotating around object with vsync on..

 

But adding a Frame lock or frame limit manually like 30 , 60 or something might be better. For example I want to lock it to 30 or 45, I dont think this is possible for now unless using third party tool.

Share this post


Link to post

You could if you just measured the time since the last frame and add a call to Time:Delay() if it's going too fast.

Share this post


Link to post

I'm just guessing here, but probably something like:

 

local fpsLimit = 30.0
local deltaTime = 1.0 / Time:UPS()
local limitedRate = 1.0 / fpsLimit
if deltaTime < limitedRate then
Time:Delay((limitedRate - deltaTime) * 1000)
end

Share this post


Link to post

Wohoo. I'm impressed with leadwerks community. I wonder why I left Leadwerks last year..

 

Thank Brutile. It works, sorta. I think I get it now. Need few tweaks.

 

Thanks again.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
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.

×
×
  • Create New...