tumira Posted December 18, 2016 Share Posted December 18, 2016 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. 1 Quote Link to comment Share on other sites More sharing options...
DooMAGE Posted December 18, 2016 Share Posted December 18, 2016 A frame cap limit would be nice! Quote My Leadwerks games! https://ragingmages.itch.io/ Link to comment Share on other sites More sharing options...
gamecreator Posted December 18, 2016 Share Posted December 18, 2016 I thought this already existed. First, turn vsync on but may want to double check the forums too. Quote Link to comment Share on other sites More sharing options...
DooMAGE Posted December 18, 2016 Share Posted December 18, 2016 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. Quote My Leadwerks games! https://ragingmages.itch.io/ Link to comment Share on other sites More sharing options...
gamecreator Posted December 18, 2016 Share Posted December 18, 2016 http://www.leadwerks.com/werkspace/topic/15196-cap-framerate-without-vsync/ Quote Link to comment Share on other sites More sharing options...
tumira Posted December 19, 2016 Author Share Posted December 19, 2016 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. Quote Link to comment Share on other sites More sharing options...
DooMAGE Posted December 19, 2016 Share Posted December 19, 2016 yeah looks like it's not possible now, but would be a nice feature. Quote My Leadwerks games! https://ragingmages.itch.io/ Link to comment Share on other sites More sharing options...
Josh Posted December 22, 2016 Share Posted December 22, 2016 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. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
tumira Posted December 23, 2016 Author Share Posted December 23, 2016 @Josh Example ? If I want to limit it to 30fps or 60fps ? Quote Link to comment Share on other sites More sharing options...
Brutile Posted December 23, 2016 Share Posted December 23, 2016 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 1 Quote Link to comment Share on other sites More sharing options...
tumira Posted December 23, 2016 Author Share Posted December 23, 2016 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. 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.