-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolving #2153 Added ability to set frame-lock. #2765
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few readability changes would be good
Added comments as requested + added check is typing inside of input [in this case don't apply]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be good for testing @alisaad673
src/components/app/App.jsx
Outdated
@@ -141,6 +141,43 @@ export const App = () => { | |||
|
|||
}, [] ); | |||
|
|||
useEffect( () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a good place to hook in the functionality. It sounds more like a job for ioManager
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated and moved key handling to ioManager.
Decreasing and increasing the limit seems to be working fine but render fps don't go be beyond 60 fps even if the limit is set at 100fps. Is it dependent on refresh rate of screen? bandicam.2022-04-13.00-15-51-603.mp4 |
Usually max refresh rate is 60fps. But if your device has low performance and you get max 40fps for example you can not go beyond this physical limit of computation power of your device. |
This should be determined by the browser and how fast it fires (note that we should not hardcode any values here) |
so anything to be changed ? |
@@ -71,6 +71,10 @@ export default class Webaverse extends EventTarget { | |||
constructor() { | |||
super(); | |||
|
|||
this.lastRenderTime = 0; | |||
this.renderFrame = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are poor variable names. Is it the number of frames? A Boolean? A time?
@@ -570,6 +570,30 @@ ioManager.keydown = e => { | |||
debug.toggle(); | |||
break; | |||
} | |||
case 187: { // + & shift [plus - not on num-pad] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than this keyboard hack, this should be in the settings.
This isn't likely to ship. |
Added ability to increase / decrease max FPS.
By default disabled.
By pressing shift & - -> decrease the limit.
By pressing shift & + -> increase the limit.
Also updated stats FPS with render FPS & loopFPS: